7.14. SetCrowdValues

set_crowd_source_value ‐ Dynamic modification of the source quads in a crowd

set_crowd_intermediary_target_value ‐ Dynamic modification of the intermediary target quads in a crowd

set_crowd_target_value ‐ Dynamic modification of the target quads in a crowd

set_crowd_obstacle_value ‐ Dynamic modification of the obstacle quads in a crowd

7.14.1. Attributes

NameTypeDefaults
indexINTEGERNone (required)
operatorSTRINGNone (required)

7.14.2. Description

This action is used to modify the values associated with some of the geometrical components of a crowd element. The integer value of the index attribute defines the rank of the quad in the list of quads of its type (source quads for set_crowd_source_value, for instance). Ranks begin at 1. The string value of the operator attribute is an operator string. The values of the operator must be "=", "=", "+=", "-=", "*=", or "/=". The child node is a quad element that contains at least one attribute and its associated value. If the attribute values contain parenthesized expressions, they are dynamically evaluated as numerical expressions and their values are replaced in the attribute value strings.

The attributes of the child node are called source attributes. If the target node contains at least quad no quad(s) of the target type (sources, intermediary targets, targets, or obstacles depending on the selected action), the values of the source attributes are used to modify the values of the corresponding attributes in the quad number quad no of the target crowd node.

For instance if the action is set_crowd_intermediary_target_value and if the quad child node contains the attributes x1, y1, and z1, and if the operator is "=", the coordinates of the first point in the quad child node replace the coordinates of the first point in the target quad (the intermediary crowd target number quad no). The other operators respectively correspond to addition, substraction, multiplication, and division of the target values by the source values. The attributes of the target quad that are not instantiated in the source quad (the child node) are not modified by this action.

7.14.3. Expected children

The following element must occur in set_crowd_source_value, set_crowd_intermediary_target_value, set_crowd_target_value, or set_crowd_obstacle_value: one quad element.

7.14.4. Expected target

The target node must contain a crowd element.

7.14.5. Example

The example below defines an action that translates the first crowd target by ten units in the x direction.

<set_crowd_target_value index="1" operator="+=">
  <quad x1="10" x2="10" x3="10" x4="10"/>
</set_crowd_target_value>