Constraining the Legs to the Ground

 
 
 

You can constrain the actor's legs to solve some problems related to terrains. When you create a terrain, the position of each particle (actor) is automatically updated so that it moves along this surface. Because only the particle's position is updated, the actor's envelope size and shape is not taken into account with this position update, which means that feet and legs may penetrate the terrain.

The camera is usually far away from the actors in a typical crowd scene, so the penetration may not be noticeable. However, there may be particular scenes or shots where the penetration is more noticeable, and need a constraint to solve the problem.

In the image below, the legs go through the hill because they're not constrained to the terrain.

In the image below, the legs stay above the terrain because they're constrained. Notice that there is still some foot penetration into the hill, but this wouldn't be noticeable if the camera was farther from the crowd. You can also increase the offset of the leg from the terrain to reduce some of the penetration.

To constrain the legs to the terrain:

  1. Make sure that the deformers are parented correctly in the rig proxy for constraining the legs - see Modifying the Actor's Rig.
  2. Create a terrain for the crowd simulation - see Terrains for Crowds.

  3. In the simulation point cloud's Skeleton Simulation ICE tree, get a Crowd Legs on Ground Constraint compound and plug it into an ICETree port below Set Locomotion.

    Constraints need to be evaluated after Set Locomotion (which contains the Pose State compounds) because that compound sets the actor's global transformation of each deformer in the rig proxy per particle.

    If you're using the Crowd Stride Control constraint in conjunction with this constraint, plug this constraint below the Crowd Stride Control compound so that the stride length is calculated first.

    Note

    You can also use this compound in another ICE tree in the Simulation region and put it above the tree that contains Set Locomotion, or in the Post-Simulation region below the ICE tree that contains Set Shape Instance Bones.

  4. In the Crowd Legs on Ground Constraint compound's property editor, specify the rig proxy deformers to use for the Left and Right legs in any of these ways. The constraint compound uses the bone lengths of the legs to figure out where they need to be constrained to the terrain.

    • Click the Pick button and select the rig proxy deformer in a view (object view or viewport) or the explorer. You can display the rig proxy as described in Modifying the Actor's Rig.
    • Click the Explorer button and select the deformer from the actor proxy's Rig_Proxies folder in the explorer that appears.
    • Enter the deformer's name in the text box, making sure to include the actor proxy's name, such as Pedestrian_Mesh.LThigh.

    Note

    Remember that left and right refer to the actor's left and right sides, not left and right according to your view of the actor.

  5. Set the Root Direction and Knee Direction to the deformer's local axis that is pointing toward its children.

    You can check to see which vector is axis forward this by selecting the root and knee deformer in the rig proxy in a 3D view and activating the Translate tool in Local mode. In this rig, the -Y direction points to the knee deformer's children.

  6. If the feet are penetrating the terrain, you can increase the Offset value.