Q3 Physics Joints

Since Rev. 2724 we provide joint setup for colliders in Q3 Physics engine.

It is possible to setup joints at design and at runtime.

We support a few standard joint types:

JointTypeDescription
TQ3JointType.FixedConstrains two rigid bodies together, removing their ability to act independent of each other.
TQ3JointType.BallAndSocketAllows motion around an indefinite number of axes. Humans have such joints in the hips and shoulders.
TQ3JointType.HingeAllows free rotation on one axis. Can be used for spinning wheels and carousels.
TQ3JointType.LimitedHingeAllows limited articulation on one axis. Humans have such joints in the fingers and knees.
TQ3JointType.PrismaticConstrains two bodies to a sliding motion on one axis. Can be used to make various sliding doors.
TQ3JointType.StiffSpringConstrains two bodies to be a certain distance apart from each other.
TQ3JointType.MagnetConstrains two bodies, where one is to be the magnet, while the other body is forced towards it in linear velocity by their difference in mass.
TQ3JointType.BuoyancyConstrains two bodies to simulate floating bodies, f.e. on water surface.

Requirements

Collider Prefab

For a working joint between two bodies, each one has to have a rigid body collider registered in the physics system. To do so, simply select your TGorillaPhysicsSystem component in the object inspector move to the “Colliders” property and add a collection item for each element.

Body A attached To Body B

Each joint item provides a ControlA and ControlB property. Those properties need to be set, otherwise the joint will not work. For most of the joint types it is important to connect the bodies in correct relation. If you'd like to create a StiffSpring joint, you need to set the child element into ControlA and the parent, where the spring “hangs”, into ControlB.

Properties

Name Description
DisplayNameDefines a name to identify the joint by the user.
EnabledActivate or deactivate this joint on creation.
JointTypeDefine the kind of connection between the two bodies by the TGorillaPhysicsJointType enumeration type: Fixed, BallAndSocket, Hinge, LimitedHinge, Prismatic, StiffSpring, Magnet or Buoyancy
ControlALink the first joint control (CHILD) - this has to have a rigid body collider prefab!
ControlBLink the second joint control (PARENT/OWNER) - this has to have a rigid body collider prefab!
AnchorSome joint types need an anchor to be defined, f.e. hinge joints. Anchors can be used to define the linking position between two bodies relatively to the parent control (ControlB)
AntiGravityFor some joint types it's helpful to apply a default anti gravity value, f.e. prismatic joints should stay in vertical position and only react on user input.
AxisSome joint types need an axis to be defined, f.e. hinge joints. The axis vector defines how the controls are able to move/rotate around on the basis of the joint. (1, 1, 1) means all directions are allowed, while (0, 1, 0) means, that only the y-axis movement/rotation is allowed
BreakForceDefine the minimum power where the joint breaks by force. If a joint breaks, it will be deactivated for computation.
BreakTorqueDefine the minimum power where the joint breaks by torque. If a joint breaks, it will be deactivated for computation.
DampingSome joint types need a damping value to be defined, f.e. spring joints.
StiffnessSome joint types need a stiffness value to be defined, f.e. spring joints.
RestLengthSome joint types need a rest-length value to be defined, f.e. spring joints.
MaxValueDefine a maximum limit, f.e. used by prismatic joints
MinValueDefine a minimum limit, f.e. used by prismatic joints
MotorTGorillaPhysicsMotorType: NoMotor, RotationMotor, AngularVelocityMotor, PositionMotor, LinearVelocityMotor, VelocityMotor
MotorForceIf a motor type was selected, by the motor force value you can control the intensity of the motor computation.

Motors

Motors allow a joint to compute some automated behaviour during its handling. Sometimes you want to automatically rotate an object around its axis, like a paddle wheels of a ship floating on water by a buoyancy joint.

TypeDescription
TGorillaPhysicsMotorType.NoMotorMotor compuation deactivated.
TGorillaPhysicsMotorType.RotationMotorAn rotation motor, continuesly applies the motor force value to the quaternion / rotation matrix information for a constant rotation.
TGorillaPhysicsMotorType.AngularVelocityMotorAn angular motor, continuesly applies the motor force value to the angular velocity value. In case of a still object this will lead to faster and faster rotation.
TGorillaPhysicsMotorType.PositionMotorA linear motor, drives towards a position. A motorized prismatic joint that drives toward the specified relative target position. The axis is the direction of motion.
TGorillaPhysicsMotorType.LinearVelocityMotorA linear motor, drives towards a velocity. A motorized prismatic joint that drives to a constant target relative velocity. The axis is the direction of motion.
TGorillaPhysicsMotorType.VelocityMotorA velocity motor drives towards angular and linear velocity. Use this type of motor f.e. for wheels of cars or paddlewheels of ships.

Joint Types

Fixed Joint

Constrains two rigid bodies together, removing their ability to act independent of each other.

The joint will try to keep the original distance between the bodies as best as possible. But due to collisions with other colliders it might happen that the fixed connection is getting unconsolidated.

Ball And Socket Joint

Allows motion around an indefinite number of axes. Humans have such joints in the hips and shoulders.

Hinge Joint

Allows free rotation on one axis. Can be used for spinning wheels and carousels.

Limited Hinge Joint

Allows limited articulation on one axis. Humans have such joints in the fingers and knees.

Prismatic Joint

Constrains two bodies to a sliding motion on one axis. Can be used to make various sliding doors.

Stiff Spring Joint

Constrains two bodies to be a certain distance apart from each other.

Magnet Joint

Constrains two bodies, where one is to be the magnet, while the other body is forced towards it in linear velocity by their difference in mass.

Buoyancy Joint

Constrains two bodies to simulate floating bodies, f.e. on water surface.