Raycast Gizmos visualizer
1.0
|
Structure wrapper for Raycast More...
Public Member Functions | |
RaycastData (Vector3 _origin, Vector3 _direction, float _distance) | |
RaycastData (Ray ray, float distance) | |
bool | Raycast (Vector3 _origin, Vector3 _direction, float _maxDistance=Mathf.Infinity, int layerMask=Physics.DefaultRaycastLayers, QueryTriggerInteraction queryTriggerInteraction=QueryTriggerInteraction.UseGlobal) |
Casts a ray, from point origin, in direction direction, of length maxDistance, against all colliders in the scene. More... | |
bool | Raycast (int layerMask=Physics.DefaultRaycastLayers, QueryTriggerInteraction queryTriggerInteraction=QueryTriggerInteraction.UseGlobal) |
Casts a ray, from point origin, in direction direction, of length maxDistance, against all colliders in the scene. More... | |
int | RaycastNonAlloc (Vector3 _origin, Vector3 _direction, ref RaycastHit[] hits, float _maxDistance=Mathf.Infinity, int layerMask=Physics.DefaultRaycastLayers, QueryTriggerInteraction queryTriggerInteraction=QueryTriggerInteraction.UseGlobal) |
Physics.RaycastNonAlloc More... | |
int | RaycastNonAlloc (ref RaycastHit[] hits, int layerMask=Physics.DefaultRaycastLayers, QueryTriggerInteraction queryTriggerInteraction=QueryTriggerInteraction.UseGlobal) |
Physics.RaycastNonAlloc More... | |
void | DrawGizmos (Color color, Color hitColor) |
Provide vizualize information (Gizmos) More... | |
void | DrawAllGizmos (ref RaycastHit[] raycastHits, int validArraySize, Color color=default(Color), Color hitColor=default(Color)) |
Provide vizualize information (Gizmos) More... | |
void | Update (Vector3 _origin, Vector3 _direction, float _maxDistance) |
Update parameters More... | |
void | Reset () |
Reset parameters More... | |
override string | ToString () |
Provide vizualize information (Gizmos) More... | |
Vector3 | GetRayEndPoint () |
Get hit end point or point on max distance. More... | |
Public Attributes | |
Vector3 | origin |
The starting point of the ray in world coordinates. More... | |
Vector3 | direction |
The direction in which to cast the ray. More... | |
float | maxDistance |
The max length of the cast. More... | |
Properties | |
static RaycastData | NONE [get] |
RaycastHit | hitResult [get, set] |
hit result cached from last physics check. More... | |
bool | hitted [get] |
bool, True if last physics result are hit. More... | |
int | hitCount [get] |
hit count from last physics check. More... | |
Structure wrapper for Raycast
Kit.Physic.RaycastData.RaycastData | ( | Vector3 | _origin, |
Vector3 | _direction, | ||
float | _distance | ||
) |
Kit.Physic.RaycastData.RaycastData | ( | Ray | ray, |
float | distance | ||
) |
void Kit.Physic.RaycastData.DrawAllGizmos | ( | ref RaycastHit [] | raycastHits, |
int | validArraySize, | ||
Color | color = default(Color) , |
||
Color | hitColor = default(Color) |
||
) |
Provide vizualize information (Gizmos)
raycastHits | The cached array of Raycast result. |
validArraySize | The cached hit count from result. |
color | main color of Gizmos |
hitColor | hit color of Gizmos |
Implements Kit.Physic.IRayAllStruct.
void Kit.Physic.RaycastData.DrawGizmos | ( | Color | color, |
Color | hitColor | ||
) |
Provide vizualize information (Gizmos)
color | main color of Gizmos |
hitColor | hit color of Gizmos |
Implements Kit.Physic.IRayStruct.
Vector3 Kit.Physic.RaycastData.GetRayEndPoint | ( | ) |
Get hit end point or point on max distance.
bool Kit.Physic.RaycastData.Raycast | ( | Vector3 | _origin, |
Vector3 | _direction, | ||
float | _maxDistance = Mathf.Infinity , |
||
int | layerMask = Physics.DefaultRaycastLayers , |
||
QueryTriggerInteraction | queryTriggerInteraction = QueryTriggerInteraction.UseGlobal |
||
) |
Casts a ray, from point origin, in direction direction, of length maxDistance, against all colliders in the scene.
_origin | The starting point of the ray in world coordinates. |
_direction | The direction of the ray. |
_maxDistance | The max distance the ray should check for collisions. |
layerMask | A Layer mask that is used to selectively ignore Colliders when casting a ray. |
queryTriggerInteraction | Specifies whether this query should hit Triggers. |
bool Kit.Physic.RaycastData.Raycast | ( | int | layerMask = Physics.DefaultRaycastLayers , |
QueryTriggerInteraction | queryTriggerInteraction = QueryTriggerInteraction.UseGlobal |
||
) |
Casts a ray, from point origin, in direction direction, of length maxDistance, against all colliders in the scene.
layerMask | A Layer mask that is used to selectively ignore Colliders when casting a ray. |
queryTriggerInteraction | Specifies whether this query should hit Triggers. |
int Kit.Physic.RaycastData.RaycastNonAlloc | ( | Vector3 | _origin, |
Vector3 | _direction, | ||
ref RaycastHit [] | hits, | ||
float | _maxDistance = Mathf.Infinity , |
||
int | layerMask = Physics.DefaultRaycastLayers , |
||
QueryTriggerInteraction | queryTriggerInteraction = QueryTriggerInteraction.UseGlobal |
||
) |
Physics.RaycastNonAlloc
_origin | The starting point of the ray in world coordinates. |
_direction | The direction of the ray. |
_maxDistance | The max distance the ray should check for collisions. |
hits | output RaycastHit |
layerMask | |
queryTriggerInteraction |
int Kit.Physic.RaycastData.RaycastNonAlloc | ( | ref RaycastHit [] | hits, |
int | layerMask = Physics.DefaultRaycastLayers , |
||
QueryTriggerInteraction | queryTriggerInteraction = QueryTriggerInteraction.UseGlobal |
||
) |
Physics.RaycastNonAlloc
hits | output RaycastHit |
layerMask | |
queryTriggerInteraction |
to define it's being hit, hitted
void Kit.Physic.RaycastData.Reset | ( | ) |
Reset parameters
Implements Kit.Physic.IRayStructBase.
override string Kit.Physic.RaycastData.ToString | ( | ) |
Provide vizualize information (Gizmos)
Implements Kit.Physic.IRayStructBase.
void Kit.Physic.RaycastData.Update | ( | Vector3 | _origin, |
Vector3 | _direction, | ||
float | _maxDistance | ||
) |
Update parameters
_origin | The starting point of the ray in world coordinates. |
_direction | The direction of the ray. |
_maxDistance | The max distance the ray should check for collisions. |
Vector3 Kit.Physic.RaycastData.direction |
The direction in which to cast the ray.
float Kit.Physic.RaycastData.maxDistance |
The max length of the cast.
Vector3 Kit.Physic.RaycastData.origin |
The starting point of the ray in world coordinates.
|
get |
hit count from last physics check.
|
getset |
hit result cached from last physics check.
|
get |
bool, True if last physics result are hit.
|
staticget |