Character Controller Pro  1.3.8
A 2D/3D character controller asset for the Unity Engine.
Lightbug.CharacterControllerPro.Core.CharacterCollisions Class Reference

Public Member Functions

void Initialize (CharacterActor characterActor, PhysicsComponent physicsComponent)
 
CollisionInfo CheckForGround (Vector3 position, float stepOffset, float stepDownDistance, in HitInfoFilter hitInfoFilter)
 Checks vertically for the ground using a SphereCast. More...
 
CollisionInfo CheckForGroundRay (Vector3 position, in HitInfoFilter hitInfoFilter)
 Checks vertically for the ground using a Raycast. More...
 
CollisionInfo CastBody (Vector3 position, Vector3 displacement, float bottomOffset, in HitInfoFilter hitInfoFilter)
 
bool CheckOverlapWithLayerMask (Vector3 position, float bottomOffset, in HitInfoFilter hitInfoFilter)
 Checks if the character is currently overlapping with any obstacle from a given layermask. More...
 
bool CheckBodySize (Vector3 size, Vector3 position, in HitInfoFilter hitInfoFilter)
 Checks if the character size fits at a specific location. More...
 
bool CheckBodySize (Vector3 size, in HitInfoFilter hitInfoFilter)
 Checks if the character size fits in place. More...
 
void UpdateCollisionInfo (CollisionInfo collisionInfo, Vector3 position, in HitInfo hitInfo, Vector3 displacement, Vector3 castDisplacement, float preDistance, bool useContactNormal, bool calculateEdge=true, in HitInfoFilter hitInfoFilter=new HitInfoFilter())
 

Public Attributes

float ContactOffset => characterActor.Is2D ? Physics2D.defaultContactOffset : CharacterConstants.SkinWidth
 
float CollisionRadius => characterActor.Is2D ? characterActor.BodySize.x / 2f : characterActor.BodySize.x / 2f - ContactOffset
 

Member Function Documentation

◆ CheckBodySize() [1/2]

bool Lightbug.CharacterControllerPro.Core.CharacterCollisions.CheckBodySize ( Vector3  size,
Vector3  position,
in HitInfoFilter  hitInfoFilter 
)
inline

Checks if the character size fits at a specific location.

◆ CheckBodySize() [2/2]

bool Lightbug.CharacterControllerPro.Core.CharacterCollisions.CheckBodySize ( Vector3  size,
in HitInfoFilter  hitInfoFilter 
)
inline

Checks if the character size fits in place.

◆ CheckForGround()

CollisionInfo Lightbug.CharacterControllerPro.Core.CharacterCollisions.CheckForGround ( Vector3  position,
float  stepOffset,
float  stepDownDistance,
in HitInfoFilter  hitInfoFilter 
)
inline

Checks vertically for the ground using a SphereCast.

◆ CheckForGroundRay()

CollisionInfo Lightbug.CharacterControllerPro.Core.CharacterCollisions.CheckForGroundRay ( Vector3  position,
in HitInfoFilter  hitInfoFilter 
)
inline

Checks vertically for the ground using a Raycast.

◆ CheckOverlapWithLayerMask()

bool Lightbug.CharacterControllerPro.Core.CharacterCollisions.CheckOverlapWithLayerMask ( Vector3  position,
float  bottomOffset,
in HitInfoFilter  hitInfoFilter 
)
inline

Checks if the character is currently overlapping with any obstacle from a given layermask.


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