Value>MAXWrapper>Node>Helper> Delegate |
The Delegate helper object is a special pyramidal object used in crowd animation. By default, the point of the pyramid indicates the forward direction.
The Crowd object controls the delegate or delegates, whose motion can then be imparted to a biped or other object.
The width of the Delegate object.
The depth of the Delegate object.
The height of the Delegate object.
When showVelocity is true, uses the specified color to draw a vector in the delegate's center during the simulation solution. The vector length indicates the delegate's relative speed.
The delegate object is subject to control by a Crowd object.
The forces being applied to a delegate by any applicable behaviors are drawn as vectors whose length indicate the extent of the forces. For example, if the delegate is affected by a Space Warp behavior and a Wander behavior, the vectors (using default colors) are yellow and blue-green, respectively. These vectors are visible only during solution of the crowd simulation.
Uses the Velocity Color (see above) to draw a vector whose length depicts the delegate's relative speed. This vector is visible only during solution of the crowd simulation.
During a solve, a text label appears next to the delegate showing the name of the cognitive controller state or transition that currently directs its behavior, if any.
The delegate remains at its initial height (position on the world XY axis) throughout the simulation. When off, the delegate's height can change during the simulation, for example when seeking an object at a different height.
When true, the Avoid behavior uses the bounding box of the delegate and all of its children to perform its behavior.
This bounding box is computed by the Crowd object, is used by the collision detector, and can be accessed by other behaviors.
Specifies the delegate's baseline velocity in 3ds Max units (or the current unit type) per second. This can be modified during the simulation by a variety of factors, such as a linked biped's built-in speed and Deviation settings in a behavior.
Multiplied times Average Speed to determine the maximum acceleration.
Specifies how much a delegate should slow down when turning. The higher this setting, the more the delegate slows down when it reaches the turn angle (see following parameter). A value of 0 specifies no slowdown; a value of 1 tells the delegate to stop.
The algorithm computes a value, d, which goes linearly from 0 to (1 - Decel Weight) as the turn angle of the delegate goes from 0 to the Turn Angle specified by the user. The speed of the delegate is then multiplied by d. For example, when the delegate turns at the Turn Angle or greater, its speed will be multiplied by 1 - Decel Weight, slowing it down as much as possible based on this parameter. When the delegate is not turning at all, its speed is not affected by the Decel Weight. When the delegate is turning at half the specified Turn Angle, d = Decel Weight / 2, so its speed will be multiplied by (1 - Decel Weight / 2).
As a practical example, take a delegate traveling at 10 units/sec, Decel Weight is set to 0.4, and At Turn Angle is set to 30. When the delegate has turned 15 degrees (half the At Turn Angle), the effective deceleration weight is 0.2. Subtract that quantity from 1 to get 0.8, and then multiply that times the delegate's speed to get 8 units per second halfway into the turn. At the full turn (30 degrees), the delegate travels at 6 units per second.
Specifies the turn angle at which Decel Weight's full slowdown effect is applied. If the current turn angle is less than At Turn Angle, the algorithm divides the latter by the former, and then divides the Decel Weight setting by the result to derive the effective decel weight.
Specifies how much the delegate should slow down when moving at an upward slant.
Specifies the upward slant angle at which Decel Weight's full slowdown effect is applied.
Specifies how much the delegate should speed up when moving at a downward slant.
See Decel Weight for a full explanation, taking into account that Accel Weight produces a speedup effect rather than a slowdown. Thus, the effective acceleration weight is added to 1, not subtracted from it.
Specifies the downward slant angle at which Accel Weight's full speedup effect is applied.
Specifies the maximum number of degrees a delegate can turn.
Specifies how much the delegate's turn angle can change per frame. If this is not small, the delegate's direction might jerk around. It would be allowed to turn suddenly, rather than smoothly.
Specifies the maximum number of degrees a delegate can turn upward per frame.
Specifies the maximum number of degrees a delegate can turn downward per frame.
Specifies the maximum number of degrees a delegate can bank.
Specifies how much the delegate's bank angle can change per frame.
The number of degrees the delegate will bank as a function of the turn angle at the current frame. For example, if Bank per Turn=1, the delegate will bank one degree for every degree it is turning at a given frame.
When true, the delegate is associated with a biped.
The biped with which the delegate is associated.
The frame at which the associated biped's first clip will begin to play.
Sets the delegate priority, which determines the order of solution in biped/delegate simulations.
0 - First clip of current script
The number of frames the delegate has been in the current state.
The behaviors property contains valid values only during a solve. Contains the behaviors being used during the solve.
The weights property contains valid values only during a solve. Each element contains the weight of the corresponding behavior in the behaviors property value.
The simpos property contains a valid value only during a solve. Contains the current position of the delegate during the simulation.
A possibly non-unique identifier whose purpose is to be used by behaviors as part of it's seed calculation. If more than one delegate has the the same randId then they should have the same random behavior. By defualt, crowd creates unique randIds.
Index used by various behaviors as indices into internal arrays. Before a solve, Crowd makes sure that the delegates who are participating in the solve are given a contiguous set of indices, so that behaviors can set up arrays which use these indices.
Returns a '1' if the delegate is currently active in a crowd solve simulation, it returns a '0' otherwise.
Returns the normalized velocity of the delegate at the current simulation frame as a Point3 value.
Returns the normalized velocity of the delegate at the previous simulation frame as a Point3 value.
Returns the normalized velocity of the delegate at the start of the crowd simulation as a Point3 value. Thus the <time> parameter is a time value that should be equal to crowd.simStart.
Returns the speed of the delegate at the current simulation frame as a float.
Returns a '1' if the delegate is active for a particular crowd assignment at the time specified, if not it returns a '0'. The <assignmentIndex> directly corresponds to the index of the assignment in the crowds.assignment array.
Returns a '0' if the biped associated with the delegate is backtracking. This method is primarily for internal use.
If true, the delegate's position/orientation is correct at the current time in the simulation, so it's ok to use the delegate's position in a MAXScript computation, thereby "reacting to" the delegate. This property will be false when you have a biped/crowd simulation with priorities, and the delegate's priority is lower so the delegate has not yet been computed. The delegate’s position is incorrect and you should not base any MAXScript computations upon its position.
The functions lineDisplay, sphereDisplay, bboxDisplay, and textDisplay are all functions which can be used to draw a graphic primitive for a particular delegate when the crowd simulation is being solved. All of the positional values are in world space. Usually these functions will be used within a scripted behavior to visually demonstrate the behavior. For example, lineDisplay could be used to draw a line that represents the force that the behavior is exerting on that delegate.
This function will draw a line from the start position to the endPosition with the color specified .
<startPosition> is a point3 value.
<endPositions> is a point3 value.
<vectorScale> boolean value. Whether or not to scale the line display by the Crowd.vectorScale value.
This function will draw a sphere at the position <position>, with a radius of size <radius>, and a color of <color>. <position> is a point3 value, radius is a float and <color> is a color value.
This function will draw a bounding box specifed by the two extrema points, <minPosition> and <maxPosition>, with the color specified. <minPosition> and <maxPosition> are point3 values and <color> is a color value.
This function will draw the text found in the <string> parameter at the position specified at <position>, with the color found in <color>. <position> is a point3 value, <color> is a color value, and <string> is a string value.
Returns the delegate’s transformation matrix at the specified time as a Matrix3 value. This method returns valid values during a solve.
During a Solve, the simulation doesn't set the delegate nodes’ position and rotation keys until the simulation stops. As such, accessing the delegate nodes’ position and rotation during the solve will return incorrect results. The position of a delegate during a solve can be accessed via the .simpos property.
Delegates cannot be rendered, so the size of the Delegate object is primarily for use in scene setup and for determining bounding box extents.