Raycast Gizmos visualizer  1.0
Kit.Physic.BoxCastData Struct Reference

Casts the box along a ray and returns detailed information on what was hit. More...

Inheritance diagram for Kit.Physic.BoxCastData:
Kit.Physic.IRayStruct Kit.Physic.IRayAllStruct Kit.Physic.IRayStructBase Kit.Physic.IRayStructBase

Public Member Functions

 BoxCastData (Ray _ray, float _maxDistance, Vector3 _halfExtends, Quaternion _localRotation)
 
 BoxCastData (Vector3 _origin, Vector3 _halfExtends, Vector3 _direction, Quaternion _localRotation=default(Quaternion), float _maxDistance=Mathf.Infinity)
 
bool BoxCast (Vector3 _center, Vector3 _halfExtends, Vector3 _direction, Quaternion _orientation=default(Quaternion), float _maxDistance=Mathf.Infinity, int layerMask=Physics.DefaultRaycastLayers, QueryTriggerInteraction queryTriggerInteraction=QueryTriggerInteraction.UseGlobal)
 Casts the box along a ray and returns detailed information on what was hit. More...
 
bool BoxCast (int layerMask=Physics.DefaultRaycastLayers, QueryTriggerInteraction queryTriggerInteraction=QueryTriggerInteraction.UseGlobal)
 Casts the box along a ray and returns detailed information on what was hit. More...
 
int BoxCastNonAlloc (Vector3 _center, Vector3 _halfExtends, Vector3 _direction, RaycastHit[] hits, Quaternion _orientation=default(Quaternion), float _maxDistance=Mathf.Infinity, int layerMask=Physics.DefaultRaycastLayers, QueryTriggerInteraction queryTriggerInteraction=QueryTriggerInteraction.UseGlobal)
 Cast the box along the direction, and store hits in the provided buffer. More...
 
int BoxCastNonAlloc (RaycastHit[] hits, int layerMask=Physics.DefaultRaycastLayers, QueryTriggerInteraction queryTriggerInteraction=QueryTriggerInteraction.UseGlobal)
 Cast the box along the direction, and store hits in the provided buffer. More...
 
void DrawGizmos (Color color=default(Color), Color hitColor=default(Color))
 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 _center, Vector3 _halfExtends, Vector3 _direction, Quaternion _orientation, float _maxDistance)
 Update parameters More...
 
void Update (Vector3 _center, 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 center
 Center of the box. More...
 
Vector3 halfExtends
 Half the size of the box in each dimension. More...
 
Vector3 direction
 The direction in which to cast the box. More...
 
float maxDistance
 The max length of the cast. More...
 
Quaternion orientation
 Rotation of the box. More...
 

Properties

static BoxCastData 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...
 

Detailed Description

Casts the box along a ray and returns detailed information on what was hit.

Constructor & Destructor Documentation

◆ BoxCastData() [1/2]

Kit.Physic.BoxCastData.BoxCastData ( Ray  _ray,
float  _maxDistance,
Vector3  _halfExtends,
Quaternion  _localRotation 
)

◆ BoxCastData() [2/2]

Kit.Physic.BoxCastData.BoxCastData ( Vector3  _origin,
Vector3  _halfExtends,
Vector3  _direction,
Quaternion  _localRotation = default(Quaternion),
float  _maxDistance = Mathf.Infinity 
)

Member Function Documentation

◆ BoxCast() [1/2]

bool Kit.Physic.BoxCastData.BoxCast ( Vector3  _center,
Vector3  _halfExtends,
Vector3  _direction,
Quaternion  _orientation = default(Quaternion),
float  _maxDistance = Mathf.Infinity,
int  layerMask = Physics.DefaultRaycastLayers,
QueryTriggerInteraction  queryTriggerInteraction = QueryTriggerInteraction.UseGlobal 
)

Casts the box along a ray and returns detailed information on what was hit.

Parameters
_centerCenter of the box.
_halfExtendsHalf the size of the box in each dimension.
_directionThe direction in which to cast the box.
_orientationRotation of the box.
_maxDistanceThe max length of the cast.
layerMaskA Layer mask that is used to selectively ignore colliders when casting a box.
queryTriggerInteractionSpecifies whether this query should hit Triggers.
Returns
bool True, if any intersections were found.

Referenced by Kit.Physic.RaycastHelper.GetCurrentStruct().

◆ BoxCast() [2/2]

bool Kit.Physic.BoxCastData.BoxCast ( int  layerMask = Physics.DefaultRaycastLayers,
QueryTriggerInteraction  queryTriggerInteraction = QueryTriggerInteraction.UseGlobal 
)

Casts the box along a ray and returns detailed information on what was hit.

Parameters
layerMaskA Layer mask that is used to selectively ignore colliders when casting a box.
queryTriggerInteractionSpecifies whether this query should hit Triggers.
Returns
bool True, if any intersections were found.

◆ BoxCastNonAlloc() [1/2]

int Kit.Physic.BoxCastData.BoxCastNonAlloc ( Vector3  _center,
Vector3  _halfExtends,
Vector3  _direction,
RaycastHit []  hits,
Quaternion  _orientation = default(Quaternion),
float  _maxDistance = Mathf.Infinity,
int  layerMask = Physics.DefaultRaycastLayers,
QueryTriggerInteraction  queryTriggerInteraction = QueryTriggerInteraction.UseGlobal 
)

Cast the box along the direction, and store hits in the provided buffer.

Parameters
_centerCenter of the box.
_halfExtendsHalf the size of the box in each dimension.
_directionThe direction in which to cast the box.
_hitInfooutput RaycastHit
_orientationRotation of the box.
_maxDistanceThe max length of the cast.
hitsThe buffer to store the results in.
layerMaskA Layer mask that is used to selectively ignore colliders when casting a box.
queryTriggerInteractionSpecifies whether this query should hit Triggers
Returns
int The amount of hits stored to the results buffer.
See also
https://docs.unity3d.com/ScriptReference/Physics.BoxCastNonAlloc.html

Referenced by Kit.Physic.RaycastHelper.GetCurrentStruct().

◆ BoxCastNonAlloc() [2/2]

int Kit.Physic.BoxCastData.BoxCastNonAlloc ( RaycastHit []  hits,
int  layerMask = Physics.DefaultRaycastLayers,
QueryTriggerInteraction  queryTriggerInteraction = QueryTriggerInteraction.UseGlobal 
)

Cast the box along the direction, and store hits in the provided buffer.

Parameters
hitsThe buffer to store the results in.
layerMaskA Layer mask that is used to selectively ignore colliders when casting a box.
queryTriggerInteractionSpecifies whether this query should hit Triggers
Returns
int The amount of hits stored to the results buffer.
See also
https://docs.unity3d.com/ScriptReference/Physics.BoxCastNonAlloc.html

to define it's being hit, hitted

◆ DrawAllGizmos()

void Kit.Physic.BoxCastData.DrawAllGizmos ( ref RaycastHit []  raycastHits,
int  validArraySize,
Color  color = default(Color),
Color  hitColor = default(Color) 
)

Provide vizualize information (Gizmos)

Parameters
raycastHitsThe cached array of Raycast result.
validArraySizeThe cached hit count from result.
colormain color of Gizmos
hitColorhit color of Gizmos

Implements Kit.Physic.IRayAllStruct.

Referenced by Kit.Physic.RaycastHelper.GetCurrentStruct().

◆ DrawGizmos()

void Kit.Physic.BoxCastData.DrawGizmos ( Color  color = default(Color),
Color  hitColor = default(Color) 
)

Provide vizualize information (Gizmos)

Parameters
colormain color of Gizmos
hitColorhit color of Gizmos

Implements Kit.Physic.IRayStruct.

Referenced by Kit.Physic.RaycastHelper.GetCurrentStruct().

◆ GetRayEndPoint()

Vector3 Kit.Physic.BoxCastData.GetRayEndPoint ( )

Get hit end point or point on max distance.

Returns
point

◆ Reset()

void Kit.Physic.BoxCastData.Reset ( )

Reset parameters

Implements Kit.Physic.IRayStructBase.

Referenced by Kit.Physic.RaycastHelper.GetCurrentStruct().

◆ ToString()

override string Kit.Physic.BoxCastData.ToString ( )

Provide vizualize information (Gizmos)

Implements Kit.Physic.IRayStructBase.

◆ Update() [1/2]

void Kit.Physic.BoxCastData.Update ( Vector3  _center,
Vector3  _halfExtends,
Vector3  _direction,
Quaternion  _orientation,
float  _maxDistance 
)

Update parameters

Parameters
_centerCenter of the box.
_halfExtendsHalf the size of the box in each dimension.
_directionThe direction in which to cast the box.
_orientationRotation of the box.
_maxDistanceThe max length of the cast.

◆ Update() [2/2]

void Kit.Physic.BoxCastData.Update ( Vector3  _center,
Vector3  _direction,
float  _maxDistance 
)

Update parameters

Parameters
_centerCenter of the box.
_directionThe direction in which to cast the box.
_maxDistanceThe max length of the cast.

Member Data Documentation

◆ center

Vector3 Kit.Physic.BoxCastData.center

Center of the box.

◆ direction

Vector3 Kit.Physic.BoxCastData.direction

The direction in which to cast the box.

◆ halfExtends

Vector3 Kit.Physic.BoxCastData.halfExtends

Half the size of the box in each dimension.

◆ maxDistance

float Kit.Physic.BoxCastData.maxDistance

The max length of the cast.

◆ orientation

Quaternion Kit.Physic.BoxCastData.orientation

Rotation of the box.

Property Documentation

◆ hitCount

int Kit.Physic.BoxCastData.hitCount
get

hit count from last physics check.

◆ hitResult

RaycastHit Kit.Physic.BoxCastData.hitResult
getset

hit result cached from last physics check.

Referenced by Kit.Physic.RaycastHelper.GetCurrentStruct().

◆ hitted

bool Kit.Physic.BoxCastData.hitted
get

bool, True if last physics result are hit.

Referenced by Kit.Physic.RaycastHelper.CheckPhysic(), and Kit.Physic.RaycastHelper.GetCurrentStruct().

◆ NONE

BoxCastData Kit.Physic.BoxCastData.NONE
staticget

The documentation for this struct was generated from the following file: