Raycast Gizmos visualizer  1.0
Kit.Physic.SphereOverlapData Struct Reference

Structure wrapper for OverlapSphere More...

Inheritance diagram for Kit.Physic.SphereOverlapData:
Kit.Physic.IOverlapStruct Kit.Physic.IRayStructBase

Public Member Functions

 SphereOverlapData (Vector3 _origin, float _radius)
 Prepare physics raycast parameters More...
 
Collider [] Overlap (Vector3 _origin, float _radius, int layerMask=Physics.DefaultRaycastLayers, QueryTriggerInteraction queryTriggerInteraction=QueryTriggerInteraction.UseGlobal)
 Find all colliders touching or inside of the given box. More...
 
Collider [] Overlap (int layerMask=Physics.DefaultRaycastLayers, QueryTriggerInteraction queryTriggerInteraction=QueryTriggerInteraction.UseGlobal)
 Find all colliders touching or inside of the given box. More...
 
int OverlapNonAlloc (Vector3 _origin, float _radius, ref Collider[] results, int layerMask=Physics.DefaultRaycastLayers, QueryTriggerInteraction queryTriggerInteraction=QueryTriggerInteraction.UseGlobal)
 Computes and stores colliders touching or inside the sphere into the provided buffer. More...
 
int OverlapNonAlloc (ref Collider[] results, int layerMask=Physics.DefaultRaycastLayers, QueryTriggerInteraction queryTriggerInteraction=QueryTriggerInteraction.UseGlobal)
 Computes and stores colliders touching or inside the sphere into the provided buffer. More...
 
void DrawOverlapGizmos (ref Collider[] colliderResult, int validArraySize, Color color=default(Color), Color hitColor=default(Color))
 Provide vizualize information (Gizmos) More...
 
void Update (Vector3 _origin, float _radius)
 Update parameters More...
 
void Reset ()
 Reset parameters More...
 
override string ToString ()
 Provide vizualize information (Gizmos) More...
 

Public Attributes

Vector3 origin
 Center of the sphere. More...
 
float radius
 Radius of the sphere. More...
 

Properties

static SphereOverlapData NONE [get]
 
int hitCount [get]
 hit count from last physics check. More...
 
bool hitted [get]
 bool, True if last physics result are hit. More...
 

Detailed Description

Structure wrapper for OverlapSphere

Constructor & Destructor Documentation

◆ SphereOverlapData()

Kit.Physic.SphereOverlapData.SphereOverlapData ( Vector3  _origin,
float  _radius 
)

Prepare physics raycast parameters

Parameters
_originCenter of the sphere.
_radiusRadius of the sphere.

Member Function Documentation

◆ DrawOverlapGizmos()

void Kit.Physic.SphereOverlapData.DrawOverlapGizmos ( ref Collider []  colliderResult,
int  validArraySize,
Color  color = default(Color),
Color  hitColor = default(Color) 
)

Provide vizualize information (Gizmos)

Parameters
colormain color of Gizmos
hitColorhit color of Gizmos

Implements Kit.Physic.IOverlapStruct.

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

◆ Overlap() [1/2]

Collider [] Kit.Physic.SphereOverlapData.Overlap ( Vector3  _origin,
float  _radius,
int  layerMask = Physics.DefaultRaycastLayers,
QueryTriggerInteraction  queryTriggerInteraction = QueryTriggerInteraction.UseGlobal 
)

Find all colliders touching or inside of the given box.

Parameters
_originCenter of the sphere.
_radiusRadius of the sphere.
layerMaskA Layer mask that is used to selectively ignore colliders when casting a ray.
queryTriggerInteractionSpecifies whether this query should hit Triggers.
Returns
Returns an array with all colliders touching or inside the sphere.
See also
https://docs.unity3d.com/ScriptReference/Physics.OverlapSphere.html

◆ Overlap() [2/2]

Collider [] Kit.Physic.SphereOverlapData.Overlap ( int  layerMask = Physics.DefaultRaycastLayers,
QueryTriggerInteraction  queryTriggerInteraction = QueryTriggerInteraction.UseGlobal 
)

Find all colliders touching or inside of the given box.

Parameters
layerMaskA Layer mask that is used to selectively ignore colliders when casting a ray.
queryTriggerInteractionSpecifies whether this query should hit Triggers.
Returns
Returns an array with all colliders touching or inside the sphere.
See also
https://docs.unity3d.com/ScriptReference/Physics.OverlapSphere.html

◆ OverlapNonAlloc() [1/2]

int Kit.Physic.SphereOverlapData.OverlapNonAlloc ( Vector3  _origin,
float  _radius,
ref Collider []  results,
int  layerMask = Physics.DefaultRaycastLayers,
QueryTriggerInteraction  queryTriggerInteraction = QueryTriggerInteraction.UseGlobal 
)

Computes and stores colliders touching or inside the sphere into the provided buffer.

Parameters
_originCenter of the sphere.
_radiusRadius of the sphere.
resultsThe buffer to store the results in.
layerMaskA Layer mask that is used to selectively ignore colliders when casting a ray.
queryTriggerInteractionSpecifies whether this query should hit Triggers.
Returns
int The amount of colliders stored in results.

https://docs.unity3d.com/ScriptReference/Physics.OverlapSphereNonAlloc.html

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

◆ OverlapNonAlloc() [2/2]

int Kit.Physic.SphereOverlapData.OverlapNonAlloc ( ref Collider []  results,
int  layerMask = Physics.DefaultRaycastLayers,
QueryTriggerInteraction  queryTriggerInteraction = QueryTriggerInteraction.UseGlobal 
)

Computes and stores colliders touching or inside the sphere into the provided buffer.

Parameters
resultsThe buffer to store the results in.
layerMaskA Layer mask that is used to selectively ignore colliders when casting a ray.
queryTriggerInteractionSpecifies whether this query should hit Triggers.
Returns
int The amount of colliders stored in results.

https://docs.unity3d.com/ScriptReference/Physics.OverlapSphereNonAlloc.html

◆ Reset()

void Kit.Physic.SphereOverlapData.Reset ( )

Reset parameters

Implements Kit.Physic.IRayStructBase.

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

◆ ToString()

override string Kit.Physic.SphereOverlapData.ToString ( )

Provide vizualize information (Gizmos)

Implements Kit.Physic.IRayStructBase.

◆ Update()

void Kit.Physic.SphereOverlapData.Update ( Vector3  _origin,
float  _radius 
)

Update parameters

Parameters
_originCenter of the sphere.
_radiusRadius of the sphere.

Member Data Documentation

◆ origin

Vector3 Kit.Physic.SphereOverlapData.origin

Center of the sphere.

◆ radius

float Kit.Physic.SphereOverlapData.radius

Radius of the sphere.

Property Documentation

◆ hitCount

int Kit.Physic.SphereOverlapData.hitCount
get

hit count from last physics check.

◆ hitted

bool Kit.Physic.SphereOverlapData.hitted
get

bool, True if last physics result are hit.

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

◆ NONE

SphereOverlapData Kit.Physic.SphereOverlapData.NONE
staticget

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