Houdini 21.0 Nodes Geometry nodes

Agent Terrain Adaptation geometry node

Adapts agents' legs to conform to terrain and prevent the feet from sliding.

On this page
Since 15.5

This node is used to modify the transforms of agents' leg bones to avoid intersection with terrain and prevent the feet from sliding. Terrain adaptation may also be done during a crowd simulation, but this SOP can be used, for example, to adapt a cached crowd simulation to new terrain.

Parameters

Group

Specifies a group of agents that this node should affect.

Terrain Group

The primitives in the terrain geometry to use for ray intersections.

Terrain

Enable Simulation

Some optional features (such as foot locking and leaning) require access to the state of the agents on the previous frame. As a result, an embedded DOP network is used to implement the terrain adaptation. If this parameter is disabled, those features will also be disabled and the SOP will not require simulation. This can be useful for quickly producing a rough preview of the final terrain adaptation results.

Enable Foot Locking

When turned on, prevents the ankle and toe from sliding when the foot should be planted. The channels specified on the Agent Prep SOP are used to determine when the foot should be planted during the animation clip, as well as how to blend out of the locked position. This option also improves terrain adaptation for situations where the unadjusted foot position is above the terrain, since the solver can distinguish between when the foot should be planted and when the foot is actually supposed to be above the ground. This option may still be used if no terrain object is specified.

The optional agentterrainadaptation_footdown float array point attribute can be used to override the foot down values computed from the agent’s animation clips. The attribute is expected to contain a replacement foot down value for each entry in the agentrig_footchannels point attribute. This may be useful when applying terrain adaptation to cached agents.

Adjust Hips

When turned on, adjusts the position of the hips to ensure that the legs are not over-stretched when planting the feet on uneven terrain. This parameter is available when Enable Foot Locking is turned on.

Hip Offset

When Adjust Hips is turned on, this specifies an additional offset to shift the hips up or down.

Hip Shift Per Frame

When turned on, specifies how much the hips can be shifted by in a single frame. This can reduce sudden hip motion on uneven terrain. This parameter is available when Adjust Hips is turned on.

Knee Damping Threshold (%)

When the distance from the upper leg to the target ankle position is greater than this percentage of the maximum leg length, the knee angle is damped so that it smoothly approaches a 180 degree angle as the target ankle position is extended. This can prevent the knee from popping when the leg is almost fully extended.

Note

This can allow the leg to stretch slightly, as keeping the foot planted on the terrain is a higher priority.

Enable Terrain Projection

When turned on, projects the agent particles on the given terrain.

Mode

The direction of the terrain projection.

Direction Vector

Use the direction specified in Direction.

Up Attribute

Use the agent’s up attribute.

Direction

When Mode is set to Direction Vector, this is the direction of the terrain projection.

Sampling Method

Specifies whether to cast a single ray from the agent’s point (Particle), or cast a ray from each of the agent’s legs (Foot).

Sample From Agent’s Plane

When Sampling Method is set to Foot, projects the foot positions onto the plane defined by the agent’s position and the Direction vector before casting rays. This produces results that are consistent with the Particle sampling method if the agent is on flat terrain. If this option is turned off, the agent is lowered by the average distance of each foot from the terrain.

Offset

An additional offset that shifts all the agents up or down.

Enable Terrain Adaptation

When turned on, adjusts the agents' legs to conform to the terrain.

Lean Angle Per Frame

When navigating uneven terrain, the agent can lean forward or backward. When turned on, this parameter specifies the maximum angle (in degrees) that the agent can tilt in a single frame. This parameter is available when Enable Terrain Adaptation is turned on.

Backward Lean

When Enable Terrain Adaptation is turned on, this is how far (in degrees) the agent can lean backward.

Forward Lean

When Enable Terrain Adaptation is turned on, this is how far (in degrees) the agent can lean forward.

Set Up Vector to Terrain Normal

Updates the up vector to match the terrain normal. This requires that Enable Terrain Projection is enabled. This may be useful for situations such as insects crawling on walls.

Reference Direction

The agent’s axis, aligned to follow the velocity vector. For example, setting this to 1,0,0 will align the agent’s X-axis with its velocity.

Reference Up

The original up vector of the agent. This parameter is used with Reference Direction when updating the agent’s orientation.

Guides

Show Guide Geometry

When turned on, displays guide geometry indicating the positions of the lower limb joints and whether the feet are locked.

Scale

When Show Guide Geometry is turned on, this is the size of the guide geometry.

Locked Scale

When Show Guide Geometry is turned on, this is the Scale to indicate when the foot is locked.

Color

When Show Guide Geometry is turned on, this is the color of the guide geometry. When Enable Foot Locking is turned on, the color ramp indicates when the ankle and toe joints are locked or blending out of the locked position.

Simulation

Reset Simulation

Clears the entire simulation cache.

Sub Steps

The number of substeps the DOP simulation should perform each frame.

Start Frame

The frame at which the simulation starts cooking.

Scale Time

A scale factor that relates global time to the simulation time for the DOP network.

Inputs

Agents

Agent primitives.

Terrain

Terrain geometry.

Outputs

Output

The original agent primitives, with their skeletons adjusted to conform to the terrain.

See also

Geometry nodes