Class PhysicsColliderActor
A base class for all physical collider actors.
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public abstract class PhysicsColliderActor : Actor, ISerializable
Constructors
PhysicsColliderActor()
Initializes a new instance of the PhysicsColliderActor.
Declaration
protected PhysicsColliderActor()
Properties
AttachedRigidBody
Gets the attached rigid body.
Declaration
[Unmanaged]
public RigidBody AttachedRigidBody { get; }
Property Value
RigidBody
|
Methods
ClosestPoint(Vector3, out Vector3)
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
[Unmanaged]
public void ClosestPoint(Vector3 point, out Vector3 result)
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(Vector3)
Checks if a point is inside the collider.
Declaration
[Unmanaged]
public bool ContainsPoint(Vector3 point)
Parameters
Vector3
point
The point to check if is contained by the collider shape (in world-space). |
Returns
System.Boolean
True if collider shape contains a given point, otherwise false. |
OnCollisionEnter(Collision)
Called when a collision start gets registered for this collider (it collides with something).
Declaration
[Unmanaged]
public virtual void OnCollisionEnter(Collision c)
Parameters
Collision
c
The collision info. |
OnCollisionExit(Collision)
Called when a collision end gets registered for this collider (it ends colliding with something).
Declaration
[Unmanaged]
public virtual void OnCollisionExit(Collision c)
Parameters
Collision
c
The collision info. |
OnTriggerEnter(PhysicsColliderActor)
Called when a trigger touching start gets registered for this collider (the other collider enters it and triggers the event).
Declaration
[Unmanaged]
public virtual void OnTriggerEnter(PhysicsColliderActor c)
Parameters
PhysicsColliderActor
c
The other collider. |
OnTriggerExit(PhysicsColliderActor)
Called when a trigger touching end gets registered for this collider (the other collider enters it and triggers the event).
Declaration
[Unmanaged]
public virtual void OnTriggerExit(PhysicsColliderActor c)
Parameters
PhysicsColliderActor
c
The other collider. |
RayCast(Vector3, Vector3, out RayCastHit, Single)
Performs a raycast against this collider, returns results in a RaycastHit structure.
Declaration
[Unmanaged]
public bool RayCast(Vector3 origin, Vector3 direction, out RayCastHit hitInfo, float maxDistance = 3.40282347E+38F)
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. |
System.Single
maxDistance
The maximum distance the ray should check for collisions. |
Returns
System.Boolean
True if ray hits an object, otherwise false. |
RayCast(Vector3, Vector3, out Single, Single)
Performs a raycast against this collider shape.
Declaration
[Unmanaged]
public bool RayCast(Vector3 origin, Vector3 direction, out float resultHitDistance, float maxDistance = 3.40282347E+38F)
Parameters
Vector3
origin
The origin of the ray. |
Vector3
direction
The normalized direction of the ray. |
System.Single
resultHitDistance
The raycast result hit position distance from the ray origin. Valid only if raycast hits anything. |
System.Single
maxDistance
The maximum distance the ray should check for collisions. |
Returns
System.Boolean
True if ray hits an object, otherwise false. |
Events
CollisionEnter
Occurs when a collision start gets registered for this collider (it collides with something).
Declaration
[Unmanaged]
public event Action<Collision> CollisionEnter
Event Type
System.Action<Collision>
|
CollisionExit
Occurs when a collision end gets registered for this collider (it ends colliding with something).
Declaration
[Unmanaged]
public event Action<Collision> CollisionExit
Event Type
System.Action<Collision>
|
TriggerEnter
Occurs when a trigger touching start gets registered for this collider (the other collider enters it and triggers the event).
Declaration
[Unmanaged]
public event Action<PhysicsColliderActor> TriggerEnter
Event Type
System.Action<PhysicsColliderActor>
|
TriggerExit
Occurs when a trigger touching end gets registered for this collider (the other collider enters it and triggers the event).
Declaration
[Unmanaged]
public event Action<PhysicsColliderActor> TriggerExit
Event Type
System.Action<PhysicsColliderActor>
|