Physics-based character can be regarded as a set of connected body links. Each body link is simulated as a rigid body and all body links are connected based on character joints. In order to simulate the character correctly, user needs to provide correct mass and geometry information for each body links, as well as some joint properties such as joint limits. 

The overall procedural of setting up a physics character :

  1. Initialize a kinematic character with appropriate skeleton. 

  2. Create physics character using Physics Manager.
    1. phyManager = scene.getPhysicsManager();

    2. phyManager.createPhysicsCharacter("charName");
       
  3. Although step 2. will procedurally setup collision geometries and masses based on default parameters. Although this will generate the default parameters for you, they are usually not ideal for a specific character or scenario. 
     
  4. Setup collision geometries manually. 
    1. phyBodyLink = phyManager.getJointObj("charName","jointName"); # get corresponding body link for joint "jointName" from character "charName".
    2. phyBodyLink.setStringAttribute("geomType",geomShape); # This command set the collision geometry to a different shape. Here 'geomShape' is a string value. It can be either "box", "capsule" , or "sphere".
    3. phyBodyLink.setVec3Attribute("geomSize",size); # This command set the size for collision geometry. 
       
  5. Setup mass.
    1. phyBodyLink = phyManager.getJointObj("charName","jointName"); # get corresponding body link for joint "jointName" from character "charName".
    2. phyBodyLink.setDoubleAttribute("mass",massValue); # set the mass for this body link.
       
  6. Setup joint limit
    1. phyJoint = phyManager.getPhysicsJoint("charName","jointName"); # get corresponding physics joint with "jointName" from character "charName".
    2. phyJoint.setVec3Attribute("axis0", dirVec); # set rotation axis0 according to dirVec. We can set axis1, axis2 similarly.
    3. phyJoint.setDoubleAttribute("axis0LimitHigh", highLimit); # set the maximum rotation angle for axis0 in positive direction. highLimit must be larger than zero. "axis1" and "axis2" can also be done similarly.
    4. phyJoint.setDoubleAttribute("axis0LimitLow", lowLimit); # set the rotation angle limit for axis0 in negative direction. lowLimit must be negative.

The above process setup a physics character with appropriate joint limits and body link geometry and mass. A proper joint limit setting should allows the character to perform all required kinematic motions within its joint limit while preventing unnatural joint angles. A proper geometry and mass should be set to approximate the actual body link shape and mass distribution. This allows more accurate collision detection and realistic response when interacting with the environment.

These settings can also be done using GUI in Resource Viewer–>Service–>Physics. ( To-Do : add GUI picture and step by step guide ).