3ds Max C++ API Reference
|
An interface class to the delegate. More...
#include <delegexp.h>
Public Member Functions | |
Delegate Parameter Query Functions | |
These functions query the delegate about the values of its parameters, all of which appear in the delegate's modify panel interface. | |
virtual DELEGexport BOOL | IsConstrainedInZ () |
Queries whether the delegate is constrained in the Z plane. | |
virtual DELEGexport float | GetAverageSpeed (TimeValue t) |
Gets the average speed of the delegate. | |
virtual DELEGexport float | GetMaxAccel (TimeValue t) |
Gets the maximum acceleration of the delegate. | |
virtual DELEGexport float | GetMaxHeadingVel (TimeValue t) |
Gets the maximum heading velocity of the delegate. | |
virtual DELEGexport float | GetMaxHeadingAccel (TimeValue t) |
Gets the maximum heading acceleration of the delegate. | |
virtual DELEGexport float | GetMaxPitchVel (TimeValue t) |
Gets the maximum pitch velocity of the delegate. | |
virtual DELEGexport float | GetMaxPitchAccel (TimeValue t) |
Gets the maximum pitch acceleration of the delegate. | |
virtual DELEGexport float | GetMaxIncline (TimeValue t) |
Gets the maximum incline angle of the delegate. | |
virtual DELEGexport float | GetMaxDecline (TimeValue t) |
Gets the maximum decline angle of the delegate. | |
virtual DELEGexport BOOL | OkToDisplayMyForces () |
Queries if the the delegate should display the forces acting upon it during a simulation | |
virtual DELEGexport BOOL | OkToDisplayMyVelocity () |
Queries if the delegate should display its velocity during a simulation. | |
virtual DELEGexport BOOL | OkToDisplayMyCogStates () |
Queries if the delegate should display its cognitive controller state during a simulation. | |
Position, Speed, Velocity, Transform Matrix during Simulation | |
virtual DELEGexport Matrix3 | GetTM (INode *node, TimeValue t) |
This function should be used instead of calling GetNodeTM during a simulation loop. | |
virtual DELEGexport Point3 | GetCurrentPosition () |
Gets the position of the delegate. | |
virtual DELEGexport Point3 | GetCurrentVelocity () |
Gets the velocity of the delegate. | |
virtual DELEGexport Point3 | GetPreviousVelocity () |
Gets the previous velocity of the delegate. | |
virtual DELEGexport float | GetCurrentSpeed () |
Gets the speed of the delegate. | |
virtual DELEGexport Point3 | GetSimStartVelocity (INode *n, TimeValue StartTime) |
Gets the delegate's velocity at the start of a simulation | |
Display Functions during Simulation | |
During a simulation, a behavior might want to display some information.
| |
virtual DELEGexport void | LineDisplay (const Point3 &pt1, const Point3 &pt2, Color clr, BOOL scale) |
Draws a line segment while the simulation is running. | |
virtual DELEGexport void | BboxDisplay (Point3 &pt1, Point3 &pt2, Color clr) |
Draws a bounding box while the simulation is running. | |
virtual DELEGexport void | SphereDisplay (Point3 &pt1, float radius, Color clr) |
Draws a sphere while the simulation is running. | |
virtual DELEGexport void | TextDisplay (Point3 &pt1, Color clr, const MCHAR *str) |
Draws text while the simulation is running. | |
Miscellanious Functions | |
virtual DELEGexport BOOL | IsComputing () |
Queries whether the delegate is currently active in a running crowd simulation. | |
virtual DELEGexport BOOL | IsAssignmentActive (int AssignIndex, TimeValue t) |
Queries whether a particular assignment is active at a particular time. | |
virtual DELEGexport int | GetIndex () |
Get the delegate's identifier. | |
virtual DELEGexport int | GetRandId () |
Gets a random id to generate varying behavior for different delegates performing the same behavior. | |
virtual DELEGexport BOOL | ComputingBiped () |
Queries the whether the delegate is associated with a computing biped. | |
virtual DELEGexport BOOL | ReactToMe () |
This function is used internally. | |
virtual DELEGexport void | ClearBacktracking () |
This function is used internally. | |
virtual DELEGexport BOOL | NeedsBacktracking () |
This function is used internally. | |
virtual DELEGexport void | SetBacktracking (int frame) |
This function is used internally. | |
virtual DELEGexport | ~IDelegate () |
Queries whether the delegate is currently active in a running crowd simulation. | |
Additional Inherited Members | |
![]() | |
static UtilExport void * | operator new (size_t size) |
Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. | |
static UtilExport void * | operator new (size_t size, const std::nothrow_t &e) |
Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. | |
static UtilExport void * | operator new (size_t size, const char *filename, int line) |
New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. | |
static UtilExport void * | operator new (size_t size, int block_type, const char *filename, int line) |
New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. | |
static UtilExport void * | operator new (size_t size, const std::nothrow_t &e, const char *filename, int line) |
New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. | |
static UtilExport void * | operator new (size_t size, unsigned long flags) |
New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. | |
static UtilExport void * | operator new (size_t size, const std::nothrow_t &e, unsigned long flags) |
New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. | |
static UtilExport void * | operator new[] (size_t size) |
New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. | |
static UtilExport void * | operator new[] (size_t size, const std::nothrow_t &e) |
New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. | |
static UtilExport void * | operator new[] (size_t size, const char *filename, int line) |
New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. | |
static UtilExport void * | operator new[] (size_t size, int block_type, const char *filename, int line) |
New operator used to allocate arrays of objects. | |
static UtilExport void * | operator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line) |
New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. | |
static UtilExport void * | operator new[] (size_t size, unsigned long flags) |
New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. | |
static UtilExport void * | operator new[] (size_t size, const std::nothrow_t &e, unsigned long flags) |
New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. | |
static UtilExport void | operator delete (void *ptr) |
Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. | |
static UtilExport void | operator delete (void *ptr, const std::nothrow_t &e) |
Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. | |
static UtilExport void | operator delete (void *ptr, const char *filename, int line) |
Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. | |
static UtilExport void | operator delete (void *ptr, int block_type, const char *filename, int line) |
Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. | |
static UtilExport void | operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line) |
Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. | |
static UtilExport void | operator delete (void *ptr, unsigned long flags) |
Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. | |
static UtilExport void | operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags) |
Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. | |
static UtilExport void | operator delete[] (void *ptr) |
Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. | |
static UtilExport void | operator delete[] (void *ptr, const std::nothrow_t &e) |
Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. | |
static UtilExport void | operator delete[] (void *ptr, const char *filename, int line) |
Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. | |
static UtilExport void | operator delete[] (void *ptr, int block_type, const char *filename, int line) |
Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. | |
static UtilExport void | operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line) |
Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. | |
static UtilExport void | operator delete[] (void *ptr, unsigned long flags) |
Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. | |
static UtilExport void | operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags) |
Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. | |
static UtilExport void * | operator new (size_t size, void *placement_ptr) |
Placement new operator. | |
static UtilExport void | operator delete (void *ptr, void *placement_ptr) |
Placement delete operator. | |
static UtilExport void * | aligned_malloc (size_t size, size_t alignment) |
Allocates memory on a specified alignment boundary. | |
static UtilExport void * | aligned_realloc (void *ptr, size_t size, size_t alignment) |
Reallocates memory on a specified alignment boundary. | |
static UtilExport void | aligned_free (void *ptr) |
Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. | |
An interface class to the delegate.
The class provides functions to directly query specific delegate information. It is mainly intended to be used by a crowd behavior plugin. This class can be returned by calling the method GetInterface() from a Delegate node. For Example:
|
inlinevirtual |
Queries whether the delegate is currently active in a running crowd simulation.
|
inlinevirtual |
Queries whether the delegate is constrained in the Z plane.
|
inlinevirtual |
Gets the average speed of the delegate.
[in] | t | - the time to retrieve the value |
|
inlinevirtual |
Gets the maximum acceleration of the delegate.
[in] | t | - the time to retrieve the value |
|
inlinevirtual |
Gets the maximum heading velocity of the delegate.
[in] | t | - the time to retrieve the value |
|
inlinevirtual |
Gets the maximum heading acceleration of the delegate.
[in] | t | - the time to retrieve the value |
|
inlinevirtual |
Gets the maximum pitch velocity of the delegate.
[in] | t | - the time to retrieve the value |
|
inlinevirtual |
Gets the maximum pitch acceleration of the delegate.
[in] | t | - the time to retrieve the value |
|
inlinevirtual |
Gets the maximum incline angle of the delegate.
[in] | t | - the time to retrieve the value |
|
inlinevirtual |
Gets the maximum decline angle of the delegate.
[in] | t | - the time to retrieve the value |
|
inlinevirtual |
Queries if the the delegate should display the forces acting upon it during a simulation
If this returns true, and the behavior has a force to display, then the behavior plugin is expected to display its force during the Perform function, by calling the IDelegate's LineDisplay function.
|
inlinevirtual |
Queries if the delegate should display its velocity during a simulation.
|
inlinevirtual |
Queries if the delegate should display its cognitive controller state during a simulation.
|
inlinevirtual |
This function should be used instead of calling GetNodeTM during a simulation loop.
This function must be called to get the transform, because internally as an optimization, the Crowd system caches the delegate's positions and doesn't set the Node's MAX transform until after the simulation is done running.
If for some reason (based on the active flag, backtracking, etc) this function determines that the delegate's values are not cached, it will then call GetNodeTM. So it is always best to use this function to get the delegate's TM, particularly during the Perform, Constrain, or Orient function of a behavior, which are only called during a Crowd simulation.
[in] | node | - The delegate's node. |
[in] | t | - the time to retrieve the value. |
|
inlinevirtual |
Gets the position of the delegate.
|
inlinevirtual |
Gets the velocity of the delegate.
|
inlinevirtual |
Gets the previous velocity of the delegate.
|
inlinevirtual |
Gets the speed of the delegate.
|
inlinevirtual |
Gets the delegate's velocity at the start of a simulation
If the node is a delegate and the start time is the simulation start time, this will return the initial velocity of the delegate, exactly as the Crowd system computes it.
This function is particularly useful to call from within a behavior's InitBeforeSim function, in order to make sure the behavior is perfectly repeatable.
[in] | n | - the node that the velocity is to be calculated for |
[in] | StartTime | - the time to retrieve the value |
|
inlinevirtual |
Draws a line segment while the simulation is running.
[in] | pt1 | - the start position of the line segment in world space |
[in] | pt2 | - the end position of the line segment in world space |
[in] | clr | - the color of the line |
[in] | scale | - whether or not the line should be scaled by the Vector Scale value specified in the Crowd Solve rollout. |
|
inlinevirtual |
Draws a bounding box while the simulation is running.
[in] | pt1 | - the minimum point of the bounding box in world space |
[in] | pt2 | - the maximum point of the bounding box in world space |
[in] | clr | - the color of the bounding box |
|
inlinevirtual |
Draws a sphere while the simulation is running.
[in] | pt1 | - the center point of the sphere in world space. |
[in] | radius | - the radius of the sphere. |
[in] | clr | - the color of the sphere. |
|
inlinevirtual |
Draws text while the simulation is running.
[in] | pt1 | - the world position of where the text will start |
[in] | clr | - the color of the text |
[in] | str | - the string of text that will be printed |
|
inlinevirtual |
Queries whether the delegate is currently active in a running crowd simulation.
|
inlinevirtual |
Queries whether a particular assignment is active at a particular time.
This is a way to ask the Crowd system whether or not a particular assignment is active at a particular frame. It is not really related to this particular delegate, but since internally the delegate has access to the crowd, it is used to get this information. Typically, this is called from within BaseBehavior::InitBeforeSim to see whether or not an assignment was active at a particular point in time during the simulation. !
[in] | AssignIndex | - an index into the list of behavior assignments in the Behavior Assignments dialog ! |
[in] | t | - the time to retrieve the value ! |
|
inlinevirtual |
Get the delegate's identifier.
|
inlinevirtual |
Gets a random id to generate varying behavior for different delegates performing the same behavior.
|
inlinevirtual |
Queries the whether the delegate is associated with a computing biped.
|
inlinevirtual |
This function is used internally.
|
inlinevirtual |
This function is used internally.
|
inlinevirtual |
This function is used internally.
|
inlinevirtual |
This function is used internally.