Skip to main content

Constraint

type Constraint = {
motionAlongX: Int32;
motionAlongY: Int32;
motionAlongZ: Int32;
motionAroundX: Int32;
motionAroundY: Int32;
motionAroundZ: Int32;
motionLowerLimit: Vec3;
motionUpperLimit: Vec3;
motionLimitSpringStiffness: Vec3;
motionLimitSpringDamping: Vec3;
swingLimitAngle: Vec2;
swingSpringStiffness: Float;
swingSpringDamping: Float;
twistLimitAngle: Vec2;
twistSpringStiffness: Float;
twistSpringDamping: Float;
linearDriveStiffness: Vec3;
linearDriveDamping: Vec3;
linearDriveForceLimit: Vec3;
angularDriveStiffness: Vec3;
angularDriveDamping: Vec3;
angularDriveForceLimit: Vec3;
driveType: Int8;
driveLinearVelocity: Vec3;
driveAngularVelocity: Vec3;
};

Defined in: node_modules/@3dverse/livelink.core/dist/_prebuild/engine_types/components.d.ts:193

A physics constraint that can be configured along 6 degrees of freedom. In its default state it behaves as a fixed constraint - that is, it rigidly fixes the constraint frames of its two entities. However, individual degrees of freedom may be unlocked to permit any combination of rotation around the x-, y- and z- axes, and translation along these axes.

Type declaration

NameTypeDescription
motionAlongXInt32Motion along the X axis
motionAlongYInt32Motion along the Y axis
motionAlongZInt32Motion along the Z axis
motionAroundXInt32Motion around the X axis
motionAroundYInt32Motion around the Y axis
motionAroundZInt32Motion around the Z axis
motionLowerLimitVec3The lower distance of the limit.
motionUpperLimitVec3The upper distance of the limit.
motionLimitSpringStiffnessVec3If greater than zero, the limit is soft, i.e. a spring pulls the joint back to the limit.
motionLimitSpringDampingVec3If greater than zero, this is the damping of the limit spring.
swingLimitAngleVec2The limit angle from the Y-axis and the Z-axis of the constraint frame. The cone limit is used if either or both swing axes are limited. The extents are symmetrical and measured in the frame of the parent. If only one swing degree of freedom is limited, the corresponding value from the cone limit defines the limit range.
swingSpringStiffnessFloatIf greater than zero, the limit is soft, i.e. a spring pulls the joint back to the limit.
swingSpringDampingFloatIf greater than zero, this is the damping of the limit spring.
twistLimitAngleVec2The twist limit controls the range of motion around the twist axis. The limit angle range is (-360, 360).
twistSpringStiffnessFloatIf greater than zero, the limit is soft, i.e. a spring pulls the joint back to the limit.
twistSpringDampingFloatIf greater than zero, this is the damping of the limit spring.
linearDriveStiffnessVec3If greater than zero, the limit is soft, i.e. a spring pulls the joint back to the limit.
linearDriveDampingVec3If greater than zero, this is the damping of the limit spring.
linearDriveForceLimitVec3The maximum impulse or force that can be exerted by the drive. -1 for no limit.
angularDriveStiffnessVec3If greater than zero, the limit is soft, i.e. a spring pulls the joint back to the limit.
angularDriveDampingVec3If greater than zero, this is the damping of the limit spring.
angularDriveForceLimitVec3The maximum impulse or force that can be exerted by the drive. -1 for no limit.
driveTypeInt8The drive type
driveLinearVelocityVec3The goal velocity for linear drive.
driveAngularVelocityVec3The goal velocity for angular drive.