MeshPin

A MeshPin Behavior (beMeshPin) pins an entity on a continuous mesh surface. This behaviors takes into account the entity previous and current positions, and computes a displacement. This displacement is projected on the mesh surface (triangles), and "folded" each time a triangle edge is met. Finally the entity position and orientation are fixed toward the new position and normal on mesh.

This Pin Behavior is mush easier to configure than UVPin, but it comes with some limitations :

  • At the moment of writing, it won't work with the Go To, Navigation and Locomotion Behaviors
  • It must still be populated in "2D" as the up vector is not a population parameter yet.
  • This behavior disables terrain adaptation, as the ground adaptation is meant to work by vertical projections.
  • When the entities replay movements, as the MeshPin Behavior generates a distorted environment, potentially from different positions and orientations, they can end crossing each other even if they are populated at distance of each other.

To choose between UVPin or MeshPin, just determine if you favor correct speed and ease of configuration (for MeshPin), or exact avoidance (then go for UVPin).

A MeshPin behavior in the Behavior Editor
 
MeshPin example
MeshPin behavior example : the green guy is pinned to the cube, the blue one is not.
Both started on top of the cube, walking forward.

CREATION

  • Behavior Editor / Behavior Library: 
  • Golaem Menu: Crowd Behaviors / Behaviors / CrowdBeMeshPin Node
  • MEL command: glmCrowdBeMeshPinCmd;

CONFIGURATION

A MeshPin Behavior defines the following specific attributes. For common attributes see Behavior Common Attributes.

MeshPin Attributes

In Maya Geometry The pinning Maya polygons. Several destination polygons can be defined in this Behavior, the entity will pin to the closest one which has a vertical projection at start.
Maya Geometry Mode

Specify whether the geometry to pin on is Static (non moving), Dynamic Transform(geometry transform changes each frame) or Dynamic Mesh (Mesh vertices and transform change each frame). Refreshing geometry can take a huge amount of time per frame.

Starting / Stopping Duration Attributes

Starting Duration

Time during which the behavior displays a blend of starting posture with fixed posture. The orientation is progressively fixed, this has only a visual effect (orientation in simulation is directly fixed with mesh normal)
Stopping Duration Time during which the behavior goes back to a default up vector = Y Axis. Once again, the changes are instantaneous and this blend has only visual impacts

Smoothing Attributes

Smooth Orientation If the posture correction needs to be (visually) progressive, this enable the maximum delta correction. This avoids flickering when the mesh is low def and has some heavy face normal jumps.
Maximum Angular Speed This is the maximum angular speed that the correction can apply. This has only a visual effect (simulation gets a direct correction).

Advanced Attributes

Evaluation Mode

Specifies if this Behavior should be evaluated before of after the Physics Behaviors.
Force Adaptation Each Frame Trigger if the entity must be adapted to mesh each frame, or only when the current face normal of the mesh change. If the mesh is dynamic, this will be forced internally.
Stick Particle On Mesh The particle will be stick to mesh, even if a motion is displacing root height
Height Offset When sticking the particle to mesh, add this static height offset to root