Table of Contents

Struct MotionLocks

Namespace
Box3D
Assembly
Box3D.NET.dll

Which axes a body is prevented from moving along or rotating about.

public readonly record struct MotionLocks : IEquatable<MotionLocks>

Implements

Inherited Members

Examples

Keeping a character upright while letting it turn:

var def = BodyDefinition.Dynamic(spawnPoint) with
{
    MotionLocks = MotionLocks.None with { AngularX = true, AngularZ = true },
};

Remarks

Locking an axis is exact and costs nothing, unlike approximating it with a very large inertia.

Properties

AngularX

Gets a value indicating whether rotation about the x axis is prevented.

AngularY

Gets a value indicating whether rotation about the y axis is prevented.

AngularZ

Gets a value indicating whether rotation about the z axis is prevented.

LinearX

Gets a value indicating whether translation along the x axis is prevented.

LinearY

Gets a value indicating whether translation along the y axis is prevented.

LinearZ

Gets a value indicating whether translation along the z axis is prevented.

NoRotation

Gets locks that prevent all rotation, leaving translation free.

None

Gets locks that restrict nothing.