Physics Joint#
This section describes the specifications for exporting Physics Joints in Unity to USD.
What is a Physics Joint?#
![Physics Joint.](../../_images/physicsJoint_01.png)
![1-to-n connections of Physics Joint.](../../_images/physicsJoint_02.png)
Types of physics joint supported for export#
Physics Joint export from Unity to USD supports the following.
Unity |
USD |
Description |
---|---|---|
FixedJoint |
FixedJoint |
Fixed connection of two shapes |
HingeJoint |
RevoluteJoint |
Rotate around 1 axis |
SpringJoint |
DistanceJoint |
Spring movement |
ConfigurableJoint |
D6Joint |
Free rotation used for character articulation.In addition, spring effects can be added for each XYZ axis. |
CharacterJoint |
D6Joint |
Free rotation used for character articulation |
FixedJoint#
![FixedJoint.](../../_images/physicsJoint_FixedJoint.png)
RevoluteJoint#
![RevoluteJoint.](../../_images/physicsJoint_RevoluteJoint.png)
SphericalJoint#
![SphericalJoint.](../../_images/physicsJoint_SphericalJoint.png)
D6Joint#
![D6Joint.](../../_images/physicsJoint_D6Joint.png)
DistanceJoint#
![DistanceJoint.](../../_images/physicsJoint_SpringJoint.png)
Specifying Physics Joint in Unity#
There are several rules for specifying Physics Joints in Unity.
Shapes participating in Physics Joint should be assigned a Rigidbody.
Rigidbody is added by a component.
![]()
By setting IsKinematic to On, the shape can be made to follow the transform operation at runtime.
The Physics Joint connects two shapes.
Add Physics Joint as a component of the shape of the connection source and specify the connection destination in its parameters.
![]()
![]()
Limitations to align specifications with USD side#
In USD, when Rigidbody is nested, the behavior is different from Unity.
Note
DO NOT structure the Rigidbody within the Rigidbody shape because this will not work in USD.
![Do not nest RigidBody.](../../_images/physicsJoint_unity_2.jpg)
Base parameters for Physics Joint#
The Joint class in Unity and the Physics Joint class in USD have parameters that are shared by all joints.
![Base parameters for Physics Joint.](../../_images/physicsJoint_param_1.png)
Unity |
USD |
Description |
---|---|---|
Body0 |
The target GameObject is used as Body0 of the USD |
|
connectedBody |
Body1 |
The shape specified in connectedBody is used as Body1 in USD |
enableCollision |
CollisionEnabled |
Enable Collision |
anchor |
LocalPosition0 |
Local center position corresponding to Body0 |
connectedAnchor |
LocalPosition1 |
Local center position corresponding to Body1 |
LocalRotation0 |
Local rotation information corresponding to Body0 |
|
LocalRotation1 |
Local rotation information corresponding to Body1 |
|
Break Force |
BreakForce |
Joint break force |
Break Torque |
BreakTorque |
Joint break torque |
LocalRotation0 and LocalRotation1 are automatically calculated from the given GameObject’s transform rotation.
![Base parameters for Physics Joint.](../../_images/physicsJoint_usd_1.png)
LocalPosition0 / LocalPosition1#
LocalPosition0 / LocalPosition1 specifies the center position in local coordinates of Body0 and Body1, respectively.
LocalRotation0 / LocalRotation1#
The rotation values for LocalRotation0/LocalRotation1 are the accumulated rotations from the common parent of the shapes corresponding to Body0 and Body1.
![Joint parameters in USD.](../../_images/physicsJoint_unity_3.jpg)
If there is rootCube and Cube and the direct parents are the same, the rotation values of the rootCube’s local transform and the Cube’s local transform are adopted, respectively.
Parameters of each Physics Joint#
Describe which parameters are passed when passing Physics Joint in Unity to USD.
FixedJoint#
![FixedJoint center.](../../_images/physicsJoint_usd_2.jpg)
HingeJoint#
![HingeJoint parameters.](../../_images/physicsJoint_hinge.png)
SpringJoint#
![SpringJoint parameters.](../../_images/physicsJoint_spring.png)
ConfigurableJoint#
![ConfigurableJoint parameters.](../../_images/physicsJoint_configurable_1.png)
![Position Spring and Position Damper.](../../_images/physicsJoint_configurable_2.png)
CharacterJoint#
![CharacterJoint parameters.](../../_images/physicsJoint_character.png)
Example of using Physics Joint#
Here is examples of how Physics Joint can be used.
Uses rotation by one axis#
![PhysicsJoint sample.](../../_images/physicsJoint_example_01.jpg)
Collider assignment#
![Set convex in Mesh Collider.](../../_images/physicsJoint_example_02.jpg)
![Displayed all colliders.](../../_images/physicsJoint_example_03.jpg)
Rigidbody assignment#
![Select the parent of the mesh and check the collider.](../../_images/physicsJoint_example_04.jpg)
![Play animation.](../../_images/unity_physics_rigidbody_movie_02.gif)
HingeJoint assignment#
![Set kinematic in Rigidbody.](../../_images/physicsJoint_example_05.jpg)
![Assign HingeJoint.](../../_images/physicsJoint_example_06.jpg)
![Play animation using HingeJoint.](../../_images/unity_physics_rigidbody_movie_03.gif)
![Play animation in USD Composer.](../../_images/unity_physics_rigidbody_movie_04.gif)
Connect multiple Physics Joints#
When connecting multiple Rigidbodies in succession, make sure that the Rigidbodies are not nested in the hierarchical structure of the scene.
![Connect multiple Physics Joints in Unity.](../../_images/physicsJoint_example_connect_multiple_01.jpg)
![Specifying Kinematic to RigidBody, Specifying FixedJoint.](../../_images/physicsJoint_example_connect_multiple_02.png)
![Specify to disable Kinematic to RigidBody, Specifying HingeJoint.](../../_images/physicsJoint_example_connect_multiple_03.jpg)
Adjust the center position with Anchor and the direction of the axis of rotation with Axis.
Check the Use Limits checkbox and specify the Min and Max of the Limit.
![Play animation.](../../_images/unity_physics_rigidbody_movie_05.gif)
Export the USD from Unity and verify that the same movement is made in Omniverse USD Composer.