Parameters |
Description |
nodeName |
name of the new point, the point names are local to the pattern that is currently being specified. offsetx, offsety, offsetz - The offset from the start position or from the pattern center, see AITRACKPAT_NODE_ABSOLUTE. If zero offset is used, the node will become an alias, that is it will not be validated and the parent position and deformation value is used directly. |
flags |
Defines the node evaluation flags, the flags are as follows and can be combined: |
AITRACKPAT_NODE_START |
If this flag is set, this node can be used as the first node in the pattern. There can be multiple start nodes. In that case the closest one is chosen. |
AITRACKPAT_NODE_ABSOLUTE |
If this flag is set, the offset is interpret as an offset from the pattern center, otherwise the offset is offset from the start position. |
AITRACKPAT_NODE_SIGNAL |
If this flag is set, a signal "OnReachedTrackPatternNode" will be send when the node is reached. |
AITRACKPAT_NODE_STOP |
If this flag is set, the advancing will be stopped, it can be continue by calling entity:ChangeAIParameter( AIPARAM_TRACKPATTERN_ADVANCE, 1 ). |
AITRACKPAT_NODE_DIRBRANCH |
The default direction at each pattern node is direction from the node position to the center of the pattern If this flag is set, the direction will be average direction to the branch nodes. parent (optional) - If this parameter is set, the start position is considered to be the parent node position instead of the pattern center. signalValue (optional) - If the signal flag is set, this value will be passed as signal parameter, it is accessible from the signal handler in data.iValue. |
Syntax: AI.AddPatternNode( nodeName, offsetx, offsety, offsetz, flags, [parent], [signalValue] )
Adds point to the track pattern. When validating the points test is made from the start position to the end position. Start position is either the pattern origin or in case the parent is provided, the parent position. The end position is either relative offset from the start position or offset from the pattern origin, this is chosen based on the node flag. The offset is clamped to the physical world based on the test method. The points will be evaluated in the same oder they are added to the descriptor, and hte system does not try to correct the evaluation order. In case hierarchies are used (parent name is defined) it is up to the pattern creator to make sure the nodes are created in such order that the parent is added before it is referenced.
AI.AddPatternNode( "point1", 1.0, 0, 0, AITRACKPAT_NODE_START+AITRACKPAT_NODE_SIGNAL, "root" );
Copyright (c) 2012. All rights reserved.
|