Setting up your character for Physics

Let's Physicalise our character, the best practice would be to have an entity close to our characterMakerLocator to get a better understanding of what we are doing, but before doing so let's setup the Golaem Crowd Unit to prevent any further problems.
 

SETTING CROWD UNITS

As always with Golaem Crowd and you should NEVER change the default value of the Maya Linear Working Unit (which is centimeter). If you do so, a lot of things (mostly dynamics) tend to go wrong within Maya. As a matter of fact, even if the Maya Linear Working Unit is set to centimeter, nDynamics applies gravity and other forces to objects as if the objects were scaled in meters.
 
Obviously not everybody wants to work at that scale. Some will consider that even if the Maya Linear Working Unit is set to centimeter, they'll consider that one square on the scene grid will be 1 dm x 1 dm. So even before creating a Poptool and starting to test your character ragdoll the first question you'd like to ask yourself is : How big is my one square grid in my scene ? 1m, 1dm, 1cm...  Now go into the crowdManager and set the Crowd Unit to this parameter. Then, when your character is summoned as a Golaem entity when he will be falling, the gravity will make sense.
 

TESTING YOUR CHARACTER'S RAGDOLL

Open your character file (gcha) into the Character Maker. To get a better understanding of what we are doing when fine tuning our character's physical shape and physical properties let's create the Golaem Entity close to the characterMakerLocator.

Let's test our character's ragdoll with his basic settings. Go inside the Behavior editor and drag and drop a Physicalise Behavior on the Behavior Flow set it to Kinematic and edit its stop trigger to end at 5 frame.

Right after this Behavior drag and drop another Physicalise Behavior in Dynamic Rigid Body this time. Set its triggers to True/True.

Play your simulation, your character is crushed and hard to recognize.

 

Defining the Character Physics Properties

You may have noticed a couple of blue shapes around each bone of the Character. Those shapes are the Character Physics Shape taken into account in the physics simulation.

  • Start by using the Reset Physics Properties button. It will autocompute a Physics Shape for the most meaningful bones.

  • You can translate the CharacterMaker Locator back on top of your character to check if it fits it correctly.
     
  • Use the Edit Physics Properties button to load a spreadsheet representing all bones and their physical properties. Double click in a cell to edit it. Before being able to edit a bone properties, this bone should be physicalized (physicalize property = true), and to be able to modify its size, the autosize property should be set to false (but let forget about the size at this step, it will be configured later). In the example below, you can notice that we used a big box on the hand bone representing all fingers. As physics simulation is a computation expensive, it is better not to physicalize all finger if it is not needed.

    See the Reference Guide for Bone Physics Properties for more details about them.

As you can see, many bones of our character have been physicalised:

To optimize our character when it comes to physics simulation let's keep only the important parts of our character. Set the undesired bone Physicalise property to False, click the Apply button and "Hide Unphysicalised Bones".

Don't forget to save your Gcha!

Defining the joint dimensions

  • Now that the Physics Shapes are correctly chosen for each bone, let's fine configure the dimensions and positions of each one. Select the Character maker locator, and make sure the "Show Ragdoll Maya Primitives" is set to true:

The physics shapes should now be present as Maya Polygons:


Left: Default Physics Shape Display - Middle: Physics Shape as Maya Primitives - Right: Edited Primitives

You can now directly use the Maya objects to change the properties of the Character Physics Shape, and ensure it fits at best the character's geometry:


Result of a simulation using the Character File defined above (Display mode in the Entity Type is set to Physics Shape)

Once once the physics shapes fits the character don't forget to save your Gcha.

EDIT JOINTS LIMITS

It's now time to give some limits to our character. 

If you doesn't see the Bone Angular Limits gizmo in the viewport go into the Character Maker Locator's attributes and increase its radius.

Then to test your character in a physics simulation go into the Physics locator attributes and set the stiffness (correct the position error) and damping (correct the velocity error) to high values.

Augmenting your Physics substeps will give you better results. see Physics Locator documentation page for more information.
 
Start with all bones limitation set to zero, this way you will see how the stiffness and damping are taking into account: your character should remain very rigid.
 
When you are happy with the results, go into the Physics Properties window of the character maker and set the limits by watching into your viewport.

 
For a clearer view remember to click on "Hide Unphysicalised Bones".
 
After correctly setting the Joint limits of all your physicalised bones, your character shall now fall with style!
 
He may now be hit by trucks, crushed by a Trex or whatever you like, you sadist. ;)