You can simulate physics on your avatar's hair, clothes, and body parts with a little bit of scripting and the help of High Fidelity's Flow script technology.
The Flow script simply mimics the natural movement of hair and other attachments on your avatar. You can manipulate and change how Flow interacts with your avatar using the Flow App. In order to use the Flow App, your avatar must contain flow threads.
A flow thread is a set of connected joints with at least one joint that complies with the following rules:
After you ensure that you have the proper flow threads, run the Flow app to enable flow for your avatar.
See this document for more information on how to run a script or app in High Fidelity.
Below are details and descriptions of the Flow app's functionality that will help you control and manipulate your avatar's flow.
While this panel does not affect the actual behavior of your avatar's flow, it will help visually debug your script.
This panel manages all motion related to joints.
This panel manages collision spheres. Every collision sphere is positioned using an existing avatar joint and offset.
The maximum amount of collisions is defined by the global COLLISION_SHAPES_LIMIT = 4.
This panel displays the output JSON data structure with your avatar's flow configuration, which you then include in your custom flow.js script.
This data can be copied and pasted into the Flow script between the lines:
// CUSTOM DATA STARTS HERE Erase existing code and paste new code here // CUSTOM DATA ENDS HERE
You can now add the modified Flow script to your avatar's FST file to see your work in action.
In order to attach a script to your avatar, you must modify your avatar's FST file to include the path where your script lives. There are two ways to update your FST file:
script = [FLOW SCRIPT URL HERE]. For example:
You can also use our Package Model tool to add your avatar script.
a. Create a folder in the path of your avatar that includes the script.
b. In the interface, go to Edit > 'Package Model as .fst'
c. Select the path in the "Script Directory" section of the Package Model tool, seen here:
When packaging your model, the tool will iterate through the directory and add each script to the FST file. Now, you can upload the folder structure to the Marketplace or to your preferred hosting service.
Here is an example of an avatar that is rigged appropriately to use with Flow: Mannequin with Hair.