KinematicCollision3D
The result of tested 3D body motion.
KinematicCollision3D contains contact data: collider, normal, travel and remainder. Check the MoveAndCollide result for null first. After MoveAndSlide, obtain results through GetSlideCollisionCount/GetSlideCollision.
GetTravel and GetRemainder differ: remainder continues motion not yet performed. Do not apply the original displacement again. Validate collider lifetime for deferred handling; a contact does not prevent a game object from being deleted.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
KinematicCollision3DConstructor
public KinematicCollision3D();Methods14
GetAnglefloat
public float GetAngle(int collisionIndex = 0, Vector3? upDirection = default);Returns the collision angle according to up_direction, which is Vector3.Up by default. This value is always positive.
| Name | Type | Default |
|---|---|---|
collisionIndex | int | 0 |
upDirection | Vector3? | default |
upDirectionIf the parameter is null, then the default value is new Vector3(0.0f, 1.0f, 0.0f).
floatGetColliderReckfellObject
public ReckfellObject GetCollider(int collisionIndex = 0);Returns the colliding body's attached ReckfellObject given a collision index (the deepest collision by default).
| Name | Type | Default |
|---|---|---|
collisionIndex | int | 0 |
ReckfellObjectGetColliderIdulong
public ulong GetColliderId(int collisionIndex = 0);Returns the unique instance ID of the colliding body's attached ReckfellObject given a collision index (the deepest collision by default). See ReckfellObject.GetInstanceId.
| Name | Type | Default |
|---|---|---|
collisionIndex | int | 0 |
ulongGetColliderRidRid
public Rid GetColliderRid(int collisionIndex = 0);Returns the colliding body's Rid used by the PhysicsServer3D given a collision index (the deepest collision by default).
| Name | Type | Default |
|---|---|---|
collisionIndex | int | 0 |
RidGetColliderShapeReckfellObject
public ReckfellObject GetColliderShape(int collisionIndex = 0);Returns the colliding body's shape given a collision index (the deepest collision by default).
| Name | Type | Default |
|---|---|---|
collisionIndex | int | 0 |
ReckfellObjectGetColliderShapeIndexint
public int GetColliderShapeIndex(int collisionIndex = 0);Returns the colliding body's shape index given a collision index (the deepest collision by default). See CollisionObject3D.
| Name | Type | Default |
|---|---|---|
collisionIndex | int | 0 |
intGetColliderVelocityVector3
public Vector3 GetColliderVelocity(int collisionIndex = 0);Returns the colliding body's velocity given a collision index (the deepest collision by default).
| Name | Type | Default |
|---|---|---|
collisionIndex | int | 0 |
Vector3GetCollisionCountint
public int GetCollisionCount();Returns the number of detected collisions.
intGetDepthfloat
public float GetDepth();Returns the colliding body's length of overlap along the collision normal.
floatGetLocalShapeReckfellObject
public ReckfellObject GetLocalShape(int collisionIndex = 0);Returns the moving object's colliding shape given a collision index (the deepest collision by default).
| Name | Type | Default |
|---|---|---|
collisionIndex | int | 0 |
ReckfellObjectGetNormalVector3
public Vector3 GetNormal(int collisionIndex = 0);Returns the colliding body's shape's normal at the point of collision given a collision index (the deepest collision by default).
| Name | Type | Default |
|---|---|---|
collisionIndex | int | 0 |
Vector3GetPositionVector3
public Vector3 GetPosition(int collisionIndex = 0);Returns the point of collision in global coordinates given a collision index (the deepest collision by default).
| Name | Type | Default |
|---|---|---|
collisionIndex | int | 0 |
Vector3GetRemainderVector3
public Vector3 GetRemainder();Unperformed displacement remaining after contact. For reflection, transform both velocity and this remainder; repeating the original segment would add excess travel.
Vector3GetTravelVector3
public Vector3 GetTravel();Returns the moving object's travel before collision.
Vector3