Class PhysicsColliderActor
A base class for all physical collider actors.
Inherited Members
Assembly: FlaxEngine.dll
File: Engine/Physics/Actors/PhysicsColliderActor.h
Syntax
public class PhysicsColliderActor : public Actor
Fields
CollisionEnter
Occurs when a collision start gets registered for this collider (it collides with something).
Declaration
public Delegate<Collision> CollisionEnter
Field Value
Delegate<Collision>
|
CollisionExit
Occurs when a collision end gets registered for this collider (it ends colliding with something).
Declaration
public Delegate<Collision> CollisionExit
Field Value
Delegate<Collision>
|
TriggerEnter
Occurs when a trigger touching start gets registered for this collider (the other collider enters it and triggers the event).
Declaration
public Delegate<PhysicsColliderActor* > TriggerEnter
Field Value
Delegate<PhysicsColliderActor >
|
TriggerExit
Occurs when a trigger touching end gets registered for this collider (the other collider enters it and triggers the event).
Declaration
public Delegate<PhysicsColliderActor* > TriggerExit
Field Value
Delegate<PhysicsColliderActor >
|
Methods
ClosestPoint(const Vector3& point, Vector3& result)
Gets a point on the collider that is closest to a given location. Can be used to find a hit location or position to apply explosion force or any other special effects.
Declaration
public virtual void ClosestPoint(const Vector3& point, Vector3& result) const = 0
Parameters
Vector3
point
The position to find the closest point to it. |
Vector3
result
The result point on the collider that is closest to the specified location. |
ContainsPoint(const Vector3& point)
Checks if a point is inside the collider.
Declaration
public virtual bool ContainsPoint(const Vector3& point) const = 0
Parameters
Vector3
point
The point to check if is contained by the collider shape (in world-space). |
Returns
bool
True if collider shape contains a given point, otherwise false. |
GetAttachedRigidBody()
Gets the attached rigid body.
Declaration
public virtual RigidBody* GetAttachedRigidBody() const = 0
Returns
RigidBody
The rigid body or null. |
OnCollisionEnter(const Collision& c)
Called when a collision start gets registered for this collider (it collides with something).
Declaration
public virtual void OnCollisionEnter(const Collision& c)
Parameters
Collision
c
The collision info. |
OnCollisionExit(const Collision& c)
Called when a collision end gets registered for this collider (it ends colliding with something).
Declaration
public virtual void OnCollisionExit(const Collision& c)
Parameters
Collision
c
The collision info. |
OnTriggerEnter(PhysicsColliderActor* c)
Called when a trigger touching start gets registered for this collider (the other collider enters it and triggers the event).
Declaration
public virtual void OnTriggerEnter(PhysicsColliderActor* c)
Parameters
PhysicsColliderActor
c
The other collider. |
OnTriggerExit(PhysicsColliderActor* c)
Called when a trigger touching end gets registered for this collider (the other collider enters it and triggers the event).
Declaration
public virtual void OnTriggerExit(PhysicsColliderActor* c)
Parameters
PhysicsColliderActor
c
The other collider. |
RayCast(const Vector3& origin, const Vector3& direction, float& resultHitDistance, float maxDistance=MAX_float)
Performs a raycast against this collider shape.
Declaration
public virtual bool RayCast(const Vector3& origin, const Vector3& direction, float& resultHitDistance, float maxDistance=MAX_float) const = 0
Parameters
Vector3
origin
The origin of the ray. |
Vector3
direction
The normalized direction of the ray. |
float
resultHitDistance
The raycast result hit position distance from the ray origin. Valid only if raycast hits anything. |
float
maxDistance
The maximum distance the ray should check for collisions. |
Returns
bool
True if ray hits an object, otherwise false. |
RayCast(const Vector3& origin, const Vector3& direction, RayCastHit& hitInfo, float maxDistance=MAX_float)
Performs a raycast against this collider, returns results in a RaycastHit structure.
Declaration
public virtual bool RayCast(const Vector3& origin, const Vector3& direction, RayCastHit& hitInfo, float maxDistance=MAX_float) const = 0
Parameters
Vector3
origin
The origin of the ray. |
Vector3
direction
The normalized direction of the ray. |
RayCastHit
hitInfo
The result hit information. Valid only when method returns true. |
float
maxDistance
The maximum distance the ray should check for collisions. |
Returns
bool
True if ray hits an object, otherwise false. |