reckfellENGINE

KinematicCollision3D

The result of tested 3D body motion.

On this page
class KinematicCollision3DReckfellSharpInherits RefCounted

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.

Working examples.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

KinematicCollision3DConstructor
# KinematicCollision3D
C#
public KinematicCollision3D();

Methods14

GetAnglefloat
# GetAngle
C#
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.

Parameters
NameTypeDefault
collisionIndexint0
upDirectionVector3?default
upDirection

If the parameter is null, then the default value is new Vector3(0.0f, 1.0f, 0.0f).

Returns float
GetColliderReckfellObject
# GetCollider
C#
public ReckfellObject GetCollider(int collisionIndex = 0);

Returns the colliding body's attached ReckfellObject given a collision index (the deepest collision by default).

Parameters
NameTypeDefault
collisionIndexint0
Returns ReckfellObject
GetColliderIdulong
# GetColliderId
C#
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.

Parameters
NameTypeDefault
collisionIndexint0
Returns ulong
GetColliderRidRid
# GetColliderRid
C#
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).

Parameters
NameTypeDefault
collisionIndexint0
Returns Rid
GetColliderShapeReckfellObject
# GetColliderShape
C#
public ReckfellObject GetColliderShape(int collisionIndex = 0);

Returns the colliding body's shape given a collision index (the deepest collision by default).

Parameters
NameTypeDefault
collisionIndexint0
Returns ReckfellObject
GetColliderShapeIndexint
# GetColliderShapeIndex
C#
public int GetColliderShapeIndex(int collisionIndex = 0);

Returns the colliding body's shape index given a collision index (the deepest collision by default). See CollisionObject3D.

Parameters
NameTypeDefault
collisionIndexint0
Returns int
GetColliderVelocityVector3
# GetColliderVelocity
C#
public Vector3 GetColliderVelocity(int collisionIndex = 0);

Returns the colliding body's velocity given a collision index (the deepest collision by default).

Parameters
NameTypeDefault
collisionIndexint0
Returns Vector3
GetCollisionCountint
# GetCollisionCount
C#
public int GetCollisionCount();

Returns the number of detected collisions.

Returns int
GetDepthfloat
# GetDepth
C#
public float GetDepth();

Returns the colliding body's length of overlap along the collision normal.

Returns float
GetLocalShapeReckfellObject
# GetLocalShape
C#
public ReckfellObject GetLocalShape(int collisionIndex = 0);

Returns the moving object's colliding shape given a collision index (the deepest collision by default).

Parameters
NameTypeDefault
collisionIndexint0
Returns ReckfellObject
GetNormalVector3
# GetNormal
C#
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).

Parameters
NameTypeDefault
collisionIndexint0
Returns Vector3
GetPositionVector3
# GetPosition
C#
public Vector3 GetPosition(int collisionIndex = 0);

Returns the point of collision in global coordinates given a collision index (the deepest collision by default).

Parameters
NameTypeDefault
collisionIndexint0
Returns Vector3
GetRemainderVector3
# GetRemainder
C#
public Vector3 GetRemainder();

Unperformed displacement remaining after contact. For reflection, transform both velocity and this remainder; repeating the original segment would add excess travel.

Returns Vector3
GetTravelVector3
# GetTravel
C#
public Vector3 GetTravel();

Returns the moving object's travel before collision.

Returns Vector3
Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.