path_setnode(ENTITY*,var node,VECTOR* pos,var* skills)
path_getnode(ENTITY*,var node,VECTOR* pos,var* skills)
Retrieves or sets position or skills from a path node.
Parameters:
ENTITY* - pointer of an entity attached to a path.
node - number of the node (1 == first node of the path).
pos - vector to receive or set the nodes xyz position, or NULL.
skills - var[6] array to receive or set the 6 node skills, or NULL.
Returns:
0 if the node does not exist, otherwise nonzero.
Modifies (path_getnode):
pos - set to the nodes xyz position.
skills - set to the 6 node skills.
Modifies (path_setnode):
nodes xyz position - set from the pos vector.
node skills - set from the skills array.
Speed:
Fast
Remarks:
- Changing a node position does not update the edge lengths. If necessary,
the lengths have to be manually updated by path_setedge.
-
For finding all nodes of a path, call path_getnode until 0 is
returned.
Example:
path_setnode(my,1,my.x, null); // place me at node 1
path_getnode(my,1, temp, my.skill1);
See also:
path_scan, path_nextnode, path_setedge,
path_spline