IC Python API:Spring Joints
Spring Joints allows you to apply spring physics to designated bone and prop hierarchies in the scene. The spring effect is calculated using an algorithm that takes into account several physics elements such as stiffness, bounciness, and damping. This script is versatile and can turn any existing bone or prop hierarchy into an active physics spring chain. You can also create a prop chain by attaching various props together and apply spring physics using this plugin.
You should familiarize yourself with the following fundamental articles before you proceed:
|Transform Math||Access recipes for 3D transformational math dealing with spatial calculations.|
|Rotation Math||Access recipes for 3D rotational math dealing with spatial calculations.|
|Error Handling||Learn to handle and debug show-stopping errors in code.|
|Handling Time||Learn to manage complex timeline features by making a special re-usable class.|
|Icons and Images||Learn to deploy icons and images inside a user interface.|
- Apply spring physics to bones or attached props.
- Create a tree list view to represent bone hierarchies.
- Update UI by receiving callback events.
- Using Timer events.
- Sample project.
- Spring Joints Python script.
- Spring Extensions Python script.
- Load or create a scene with Props attached in a required order.
- Move and/or rotate the objects around the scene.
- Load the Spring Bones script and select the desired joints in the Bones tree list view.
- Adjust the Stiffness, Bounciness, and Dampness settings:
- Stiffness: how rigid are the joints?
- Bounciness: how likely will the joints swing back and forth?
- Dampness: how fast do the joints come to a complete stop?
- You could use the [Start Simulation] button to test the spring parameters and using[Stop Simulation] to stop it.
- After you are satisfied with your settings, click the [ Apply Setting ] button and watch the bone chain swing around as the objects moves.
- You could use [Clear Key] to remove the result.
You can research the following references for the APIs deployed in this code.
- RLPy.RMath.CONST_PI) or RLPy.RMath.AlmostZero()