Adapt Position

An Adapt Position Behavior (beAdaptPosition) provides different modes (adapted on the vertices, edges, faces of a mesh) to adapt the Entity position. The Adapt Position Behavior may be particularly useful to make the Entities move in formation (the formation being defined with a mesh).
An Adapt Position Behavior in the Behavior Editor

Example of Entity positions adapted to the faces of a mesh

Creation

  • Behavior Editor / Behavior Library: 
  • Golaem Menu: Crowd Behaviors / Behaviors / CrowdBeAdaptPosition Node
  • MEL command: glmCrowdBeAdaptPositionCmd;

Configuration

An Adapt Position Behavior defines the following specific attributes. For common attributes see Behavior Common Attributes.

Position Attributes

Target Object Maya DAG Objects (locators, meshes...) which position is used to adapt the position of the Entity. If several Objects are listed, the Entities will first fill the first object, then the second...
Position Mode
  • Absolute: The Entities positions will be the Target Object components positions
  • Relative: The Entities positions will be translated the same way than the Target Object components they're linked to (if the component moves to 1 unit on the X axis, the corresponding Entity will move of 1 unit on the X axis).
Component Mode

Component of the Maya Object to which the Entity position will be adapted:

  • Object: Translate attribute of the Transform node of the Target Object
  • Vertices: Vertices of the Target Object (if the Object is a mesh)
  • Faces: Faces of the Target Object (if the Object is a mesh)
  • Edges: Edges of the Target Object (if the Object is a mesh)
  • Component: Component of the Target Object (if the Object is a particle system)
Assignment Mode

If the Component Mode is set to Vertices, Faces or Edges, this mode describes which Entity will be adapted to which Component:

  • ParticleId <-> ComponentId: PPAttribute named particleId of the Entity is used to make the assignment (if particleId equals 1, its Entity will be adapted to the vertex of id 1 of the mesh)
  • EntityIdx <-> ComponentId: the index of the Entity is used to make the assignment (if it's the first Entity, it will be adapted to the vertex of id 0 of the mesh)
  • Per-Particle Attribute: Specify the name of the PPAttribute which will be used to make the assignment
Assignment Id PPName Name of the float per-particle field of the relative particle system, containing the component id to adapt to. Available only if the Assignment Mode is set to "Per-Particle Attribute". For more information on how to use Per Particle Attributes, see Per Particle Attributes Handling.

Offset Attributes

Pos Offset Mode This attribute allows a choice of two Position Offset modes:
  • Random: Randomly offset the position with values comprised between the specified "Pos Offset Min" and "Pos Offset Max" bounds (these attributes are influenced by the random seed of the Crowd Manager)
  • Per-Particle Attribute: Use the "Pos Offsetpp Name" attribute to get the name of the vector per-particle field of the relative particle system, containing the position offset to apply.
Pos Offset Min See Random mode option of the Pos Offset Mode above.
Available only when the Pos Offset Mode is set to "Random"
Pos Offset Max See Random mode option of the Pos Offset Mode above.
Available only when the Pos Offset Mode is set to "Random"
Pos Offsetpp Name Name of the vector per-particle field of the relative particle system, containing the Position Offset value which will be added to the Entity Position (for more explanation about how to use ppAttributes, see ppAttributes Handling)
Offset is set to 0 if the ppAttribute name is empty or invalid
Available only when the Pos Offset Mode is set to "Per-Particle Attribute"