reckfellENGINE

VoxelBoxMover

Utility class allowing to reproduce simple move-and-slide logic using only voxel AABBs, similar to Minecraft physics. This class may only be used with blocky voxels. Store an instance of it within a member variable of your script, and use i

On this page
class VoxelBoxMoverReckfellSharpInherits RefCounted

Utility class allowing to reproduce simple move-and-slide logic using only voxel AABBs, similar to Minecraft physics. This class may only be used with blocky voxels. Store an instance of it within a member variable of your script, and use it within Entity._Process or Entity._PhysicsProcess (it works wherever you like).

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

Constructors1

VoxelBoxMoverConstructor
# VoxelBoxMover
C#
public VoxelBoxMover();

Methods9

GetCollisionMaskuint
# GetCollisionMask
C#
public uint GetCollisionMask();

Gets the collision mask used to detect collidable voxels. This collision mask is specific to this collision system, and is defined in VoxelBlockyModel.CollisionMask.

Returns uint
GetMaxStepHeightfloat
# GetMaxStepHeight
C#
public float GetMaxStepHeight();
Returns float
GetMotionVector3
# GetMotion
C#
public Vector3 GetMotion(Vector3 pos, Vector3 motion, Aabb aabb, Entity terrain);

Given a motion vector, returns a modified vector telling you by how much to move your character. This is similar to KinematicBody.move_and_slide, except you have to apply the movement.

Parameters
NameTypeDefault
posVector3—
motionVector3—
aabbAabb—
terrainEntity—
Returns Vector3
HasSteppedUpbool
# HasSteppedUp
C#
public bool HasSteppedUp();

When step climbing is enabled, tells when the last call to VoxelBoxMover.GetMotion caused climbing to occur. Climbing modifies the motion vector upwards so that the body is snapped on top of the step. This can have implications in character controller code, such as considering the character to be on the floor instead of having jumped.

Returns bool
Intersectsbool
# Intersects
C#
public bool Intersects(Aabb aabb, ReckfellObject terrain);

Tests if an axis-aligned box intersects with any voxel collision box. Note: due to floating point precision, you might get false positives when testing against boxes that are touching voxels bounds. If this is undesired, you might want to shrink your AABB slightly.

Parameters
NameTypeDefault
aabbAabb—
terrainReckfellObject—
Returns bool
IsStepClimbingEnabledbool
# IsStepClimbingEnabled
C#
public bool IsStepClimbingEnabled();

Tells if step climbing is enabled.

Returns bool
SetCollisionMaskvoid
# SetCollisionMask
C#
public void SetCollisionMask(uint mask);

Sets the collision mask used to detect collidable voxels. Only voxels sharing at least one bit between the masks will be detected. This collision mask is specific to this collision system, and is defined in VoxelBlockyModel.CollisionMask.

Parameters
NameTypeDefault
maskuint—
SetMaxStepHeightvoid
# SetMaxStepHeight
C#
public void SetMaxStepHeight(float height);

Sets the maximum height that can be climbed like "stairs".

Parameters
NameTypeDefault
heightfloat—
SetStepClimbingEnabledvoid
# SetStepClimbingEnabled
C#
public void SetStepClimbingEnabled(bool enabled);

When enabled, VoxelBoxMover.GetMotion will attempt to climb up small steps. This allows to implement Minecraft-like stairs.

Parameters
NameTypeDefault
enabledbool—
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.