Raycast Gizmos visualizer  1.0
Kit.Physic.RaycastHelper Class Reference

A helper class for switch between raycast and overlap. include Gizmos call for debug usage. More...

Inheritance diagram for Kit.Physic.RaycastHelper:

Classes

class  HitEvent
 

Public Types

enum  eRayType {
  eRayType.Raycast = 0, eRayType.RaycastAll, eRayType.SphereCast = 10, eRayType.SphereCastAll,
  eRayType.SphereOverlap, eRayType.CapsuleCast = 15, eRayType.CapsuleCastAll, eRayType.CapsuleOverlap,
  eRayType.BoxCast = 20, eRayType.BoxCastAll, eRayType.BoxOverlap
}
 
enum  eDebugMethod { eDebugMethod.None = 0, eDebugMethod.OnDrawGizmos = 1, eDebugMethod.OnDrawGizmosSelected = 2 }
 

Public Member Functions

bool CheckPhysic (bool forceUpdate=false)
 Unity Physic, if current raycastData hit anything. More...
 
IEnumerable< Collider > GetOverlapColliders ()
 Get colliders which are overlap the preset area. only work on Overlap type. More...
 
IEnumerable< RaycastHit > GetRaycastHits ()
 Get RaycastHits which are touching the preset area. only work on Raycast All type. More...
 
void SetMemorySize (int size)
 Set memory size based on current selected structure. More...
 
IRayStructBase GetCurrentStruct ()
 Get current selected structure based on selected eRayType More...
 

Public Attributes

float m_Distance = 1f
 
Vector3 m_LocalPosition = Vector3.zero
 
float m_Radius = 1f
 
Vector3 m_LocalPoint1 = Vector3.left
 
Vector3 m_LocalPoint2 = Vector3.right
 
Vector3 m_LocalRotation = Vector3.zero
 
Vector3 m_HalfExtends = new Vector3(.5f, .5f, .5f)
 
bool m_UnSyncRotation = false
 
bool m_FixedUpdate = true
 
LayerMask m_LayerMask = Physics.DefaultRaycastLayers
 
QueryTriggerInteraction m_QueryTriggerInteraction = QueryTriggerInteraction.UseGlobal
 
bool m_DebugLog = false
 
HitEvent OnHit
 
const string ZERO_MEMORY = "You alloced \"0\" memory size, this action will always return empty list."
 

Properties

eRayType RayType [get, set]
 
int m_HittedCount [get]
 

Detailed Description

A helper class for switch between raycast and overlap. include Gizmos call for debug usage.

Member Enumeration Documentation

◆ eDebugMethod

Enumerator
None 
OnDrawGizmos 
OnDrawGizmosSelected 

◆ eRayType

Enumerator
Raycast 
RaycastAll 
SphereCast 
SphereCastAll 
SphereOverlap 
CapsuleCast 
CapsuleCastAll 
CapsuleOverlap 
BoxCast 
BoxCastAll 
BoxOverlap 

Member Function Documentation

◆ CheckPhysic()

bool Kit.Physic.RaycastHelper.CheckPhysic ( bool  forceUpdate = false)

Unity Physic, if current raycastData hit anything.

Parameters
forceUpdatefor the case you need to update more then one time within same fixedUpdate, e.g. change position
Returns
true = hit something in the frame.

References Kit.Physic.SphereOverlapData.hitted, Kit.Physic.CapsuleOverlapData.hitted, Kit.Physic.BoxOverlapData.hitted, Kit.Physic.SphereCastData.hitted, Kit.Physic.BoxCastData.hitted, and Kit.Physic.CapsuleCastData.hitted.

◆ GetCurrentStruct()

◆ GetOverlapColliders()

IEnumerable<Collider> Kit.Physic.RaycastHelper.GetOverlapColliders ( )

Get colliders which are overlap the preset area. only work on Overlap type.

Returns
list of collider overlapped.

◆ GetRaycastHits()

IEnumerable<RaycastHit> Kit.Physic.RaycastHelper.GetRaycastHits ( )

Get RaycastHits which are touching the preset area. only work on Raycast All type.

Returns
list of raycast hits.

◆ SetMemorySize()

void Kit.Physic.RaycastHelper.SetMemorySize ( int  size)

Set memory size based on current selected structure.

Parameters
sizesize of memory to alloc.

Member Data Documentation

◆ m_DebugLog

bool Kit.Physic.RaycastHelper.m_DebugLog = false

◆ m_Distance

float Kit.Physic.RaycastHelper.m_Distance = 1f

◆ m_FixedUpdate

bool Kit.Physic.RaycastHelper.m_FixedUpdate = true

◆ m_HalfExtends

Vector3 Kit.Physic.RaycastHelper.m_HalfExtends = new Vector3(.5f, .5f, .5f)

◆ m_LayerMask

LayerMask Kit.Physic.RaycastHelper.m_LayerMask = Physics.DefaultRaycastLayers

◆ m_LocalPoint1

Vector3 Kit.Physic.RaycastHelper.m_LocalPoint1 = Vector3.left

◆ m_LocalPoint2

Vector3 Kit.Physic.RaycastHelper.m_LocalPoint2 = Vector3.right

◆ m_LocalPosition

Vector3 Kit.Physic.RaycastHelper.m_LocalPosition = Vector3.zero

◆ m_LocalRotation

Vector3 Kit.Physic.RaycastHelper.m_LocalRotation = Vector3.zero

◆ m_QueryTriggerInteraction

QueryTriggerInteraction Kit.Physic.RaycastHelper.m_QueryTriggerInteraction = QueryTriggerInteraction.UseGlobal

◆ m_Radius

float Kit.Physic.RaycastHelper.m_Radius = 1f

◆ m_UnSyncRotation

bool Kit.Physic.RaycastHelper.m_UnSyncRotation = false

◆ OnHit

HitEvent Kit.Physic.RaycastHelper.OnHit

◆ ZERO_MEMORY

const string Kit.Physic.RaycastHelper.ZERO_MEMORY = "You alloced \"0\" memory size, this action will always return empty list."

Property Documentation

◆ m_HittedCount

int Kit.Physic.RaycastHelper.m_HittedCount
get

◆ RayType

eRayType Kit.Physic.RaycastHelper.RayType
getset

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