Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
1.1.0:q3-physics-joints [2023/08/01 15:31] – admin | 1.1.0:q3-physics-joints [2023/11/02 13:27] (current) – [Motors] admin | ||
---|---|---|---|
Line 4: | Line 4: | ||
It is possible to setup joints at design and at runtime. | It is possible to setup joints at design and at runtime. | ||
+ | |||
+ | {{: | ||
We support a few standard joint types: | We support a few standard joint types: | ||
Line 17: | Line 19: | ||
|TQ3JointType.Buoyancy|Constrains two bodies to simulate floating bodies, f.e. on water surface.| | |TQ3JointType.Buoyancy|Constrains two bodies to simulate floating bodies, f.e. on water surface.| | ||
- | ===== Fixed Joint ===== | + | ===== 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 " | ||
+ | |||
+ | ==== 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 " | ||
+ | =====Properties ===== | ||
+ | |||
+ | ^Name^ Description ^ | ||
+ | |DisplayName|Defines a name to identify the joint by the user.| | ||
+ | |Enabled|Activate or deactivate this joint on creation.| | ||
+ | |JointType|Define the kind of connection between the two bodies by the TGorillaPhysicsJointType enumeration type: Fixed, BallAndSocket, | ||
+ | |ControlA|Link the first joint control (CHILD) - this has to have a rigid body collider prefab!| | ||
+ | |ControlB|Link the second joint control (PARENT/ | ||
+ | |Anchor|Some 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)| | ||
+ | |AntiGravity|For 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.| | ||
+ | |Axis|Some 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/ | ||
+ | |BreakForce|Define the minimum power where the joint breaks by force. If a joint breaks, it will be deactivated for computation.| | ||
+ | |BreakTorque|Define the minimum power where the joint breaks by torque. If a joint breaks, it will be deactivated for computation.| | ||
+ | |Damping|Some joint types need a damping value to be defined, f.e. spring joints.| | ||
+ | |Stiffness|Some joint types need a stiffness value to be defined, f.e. spring joints.| | ||
+ | |RestLength|Some joint types need a rest-length value to be defined, f.e. spring joints.| | ||
+ | |MaxValue|Define a maximum limit, f.e. used by prismatic joints| | ||
+ | |MinValue|Define a minimum limit, f.e. used by prismatic joints| | ||
+ | |Motor|TGorillaPhysicsMotorType: | ||
+ | |MotorForce|If 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. | ||
+ | |||
+ | ^Type^Description^ | ||
+ | |TGorillaPhysicsMotorType.NoMotor|Motor compuation deactivated.| | ||
+ | |TGorillaPhysicsMotorType.RotationMotor|An rotation motor, continuesly applies the motor force value to the quaternion / rotation matrix information for a constant rotation.| | ||
+ | |TGorillaPhysicsMotorType.AngularVelocityMotor|An 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.PositionMotor|A 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.LinearVelocityMotor|A 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.VelocityMotor|A 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. | Constrains two rigid bodies together, removing their ability to act independent of each other. | ||
- | ===== Ball And Socket Joint ===== | + | 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. | Allows motion around an indefinite number of axes. Humans have such joints in the hips and shoulders. | ||
- | ===== Hinge Joint ===== | + | ==== Hinge Joint ==== |
Allows free rotation on one axis. Can be used for spinning wheels and carousels. | Allows free rotation on one axis. Can be used for spinning wheels and carousels. | ||
- | ===== Limited Hinge Joint ===== | + | ==== Limited Hinge Joint ==== |
Allows limited articulation on one axis. Humans have such joints in the fingers and knees. | Allows limited articulation on one axis. Humans have such joints in the fingers and knees. | ||
- | ===== Prismatic Joint ===== | + | ==== Prismatic Joint ==== |
Constrains two bodies to a sliding motion on one axis. Can be used to make various sliding doors. | Constrains two bodies to a sliding motion on one axis. Can be used to make various sliding doors. | ||
- | ===== Stiff Spring Joint ===== | + | ==== Stiff Spring Joint ==== |
Constrains two bodies to be a certain distance apart from each other. | Constrains two bodies to be a certain distance apart from each other. | ||
- | ===== Magnet Joint ===== | + | ==== 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. | 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 ===== | + | ==== Buoyancy Joint ==== |
Constrains two bodies to simulate floating bodies, f.e. on water surface. | Constrains two bodies to simulate floating bodies, f.e. on water surface. |