struct
ConstraintComponent
- Module
- Physics
- Header
#include "Physics/Components/ConstraintComponent.h"- Namespace
Mowo- Reflection
- Reflected by MowoHeaderTool
Properties
| Type | Name | Description |
|---|---|---|
bool | enabled | Default true. |
ConstraintType | type | Default ConstraintType::Fixed. |
uint64_t | connectedEntityId | Default 0. |
bool | collideConnected | Default true. |
Vec3 | anchorA | Anchor points relative to each body's centre of mass: A on this body, B on the connected one. Both left at zero pins the joint at the bodies' own centres; Fixed and Slider instead weld the bodies in their current relative pose, which is the useful default for those two. Angles, limits and motor targets all read as THIS body relative to the connected one (or the world), whichever of the two it is attached to. Default Vec3(0.0f, 0.0f, 0.0f). |
Vec3 | anchorB | Default Vec3(0.0f, 0.0f, 0.0f). |
Vec3 | axisA | Axis (used by Hinge, Slider, and as the 6DOF joint's X axis), in the same space as the anchors Default Vec3(0.0f, 1.0f, 0.0f). |
Vec3 | axisB | Default Vec3(0.0f, 1.0f, 0.0f). |
float | hingeLimitMin | Default -180.0f. |
float | hingeLimitMax | Default 180.0f. |
bool | hingeLimitsEnabled | Default false. |
EConstraintMotorMode | hingeMotor | Hinge motor: Position holds hingeMotorTargetAngle, Velocity spins at hingeMotorTargetVelocity. Re-applied every tick, so gameplay writing the target is live. Default EConstraintMotorMode::Off. |
float | hingeMotorTargetAngle | Default 0.0f. |
float | hingeMotorTargetVelocity | Default 0.0f. |
float | hingeMotorMaxTorque | Default 100.0f. |
float | distanceMin | Default 0.0f. |
float | distanceMax | Default 1.0f. |
float | springFrequency | Spring settings (shared) Default 0.0f. |
float | springDamping | Default 0.0f. |
EConstraintAxisMotion | linearMotionX | SixDOF: per-axis freedom. Linear limits are symmetric half-ranges about the anchor; angular limits are a min/max pair per axis, where X is the twist about axisA and Y/Z the two swings (a pyramid, so each swing is authored on its own). Defaults reproduce a ball socket. Default EConstraintAxisMotion::Locked. |
EConstraintAxisMotion | linearMotionY | Default EConstraintAxisMotion::Locked. |
EConstraintAxisMotion | linearMotionZ | Default EConstraintAxisMotion::Locked. |
Vec3 | linearLimit | Default Vec3(0.5f, 0.5f, 0.5f). |
EConstraintAxisMotion | angularMotionX | Default EConstraintAxisMotion::Free. |
EConstraintAxisMotion | angularMotionY | Default EConstraintAxisMotion::Free. |
EConstraintAxisMotion | angularMotionZ | Default EConstraintAxisMotion::Free. |
Vec3 | angularLimitMin | Default Vec3(-45.0f, -45.0f, -45.0f). |
Vec3 | angularLimitMax | Default Vec3(45.0f, 45.0f, 45.0f). |
EConstraintMotorMode | linearMotorX | SixDOF motors, one per axis. Linear targets are in the connected body's joint frame (axisB = X; the world's when unattached), angular targets in this body's (axisA = X) — with the two axes authored alike, as they usually are, the frames coincide at rest. Position targets are an offset from the anchor / an Euler orientation; Velocity targets are rates. Re-applied every tick like the hinge motor. Default EConstraintMotorMode::Off. |
EConstraintMotorMode | linearMotorY | Default EConstraintMotorMode::Off. |
EConstraintMotorMode | linearMotorZ | Default EConstraintMotorMode::Off. |
Vec3 | linearMotorTargetPosition | Default Vec3(0.0f, 0.0f, 0.0f). |
Vec3 | linearMotorTargetVelocity | Default Vec3(0.0f, 0.0f, 0.0f). |
float | linearMotorMaxForce | Default 1000.0f. |
EConstraintMotorMode | angularMotorX | Default EConstraintMotorMode::Off. |
EConstraintMotorMode | angularMotorY | Default EConstraintMotorMode::Off. |
EConstraintMotorMode | angularMotorZ | Default EConstraintMotorMode::Off. |
Vec3 | angularMotorTargetRotation | Default Vec3(0.0f, 0.0f, 0.0f). |
Vec3 | angularMotorTargetVelocity | Default Vec3(0.0f, 0.0f, 0.0f). |
float | angularMotorMaxTorque | Default 100.0f. |
float | motorFrequency | Stiffness shared by every position motor, the hinge's included. For the hinge and for each 6DOF angular axis the pair describes the swing about the joint itself, however far the centre of mass sits from it. A velocity motor ignores the spring and only honours the force / torque cap. Default 2.0f. |
float | motorDamping | Default 1.0f. |
float | breakForce | Break thresholds (0 = unbreakable), compared against the solver's reaction each fixed step. Crossing either removes the joint, sets broken and raises PhysicsSystem::OnConstraintBroken plus a ConstraintBrokenEvent on the bus. Default 0.0f. |
float | breakTorque | Default 0.0f. |
float | coneHalfAngle | Default 30.0f. |
Vec3 | pulleyFixedPointA | Default Vec3(0.0f, 5.0f, 0.0f). |
Vec3 | pulleyFixedPointB | Default Vec3(1.0f, 5.0f, 0.0f). |
float | pulleyRatio | Default 1.0f. |
float | pulleyMinLength | Default 0.0f. |
float | pulleyMaxLength | Default -1.0f. |
int32_t | gearTeethA | Default 20. |
int32_t | gearTeethB | Default 20. |
int32_t | rackTeeth | Default 20. |
float | rackLength | Default 2.0f. |
int32_t | pinionTeeth | Default 20. |
std::vector<Vec3> | pathPoints | |
bool | pathLooping | Default false. |
EConstraintPathRotation | pathRotation | Default EConstraintPathRotation::Free. |
float | pathFriction | Default 0.0f. |
EConstraintMotorMode | pathMotor | Default EConstraintMotorMode::Off. |
float | pathMotorTargetVelocity | Default 1.0f. |
float | pathMotorMaxForce | Default 1000.0f. |
FPhysicsConstraintHandle | constraint | Runtime state (managed by PhysicsSystem) |
std::vector<FPhysicsConstraintHandle> | auxConstraints | |
bool | initialized | Default false. |
bool | broken | Set when the break threshold fired. A broken joint is NOT rebuilt on the next tick — before this flag existed the constraint re-formed one frame after snapping. Clear it to re-form the joint deliberately. Default false. |
float | loadForce | Default 0.0f. |
float | loadTorque | Default 0.0f. |
Generated from Physics/Components/ConstraintComponent.h via physics.json · Nov 4, 2026Version 1.0.0