Warhorse ScripBind documentation
ContentsIndexHome
PreviousUpNext
BeginTrackPattern
Syntax
C++
int BeginTrackPattern(IFunctionHandler * pH);
Parameters 
Description 
patternName 
name of the new track pattern descriptor 
flags 
The functionality flags of the track pattern. 
Validation 
The validation method describes how the pattern is validated to fit the physical world. Should be one of: 
AITRACKPAT_VALIDATE_NONE 
no validation at all. 
AITRACKPAT_VALIDATE_SWEPTSPHERE 
validate using swept sphere tests, the spehre radius is validation radius plus the entity pass radius. 
AITRACKPAT_VALIDATE_RAYCAST 
validate using raycasting, the hit position is pulled back by the amount of validation radius plus the entity pass radius. 
Aligning 
When the pattern is selected to be used the alignment of the patter ncan be changed. The alignment can be combination of the following. The descriptions are in order they are evaluated. 
AITRACKPAT_ALIGN_TO_TARGET 
Align the pattern so that the y-axis will point towards the target each time it is set. If the agent does not have valid attention target at the time the pattern is set the pattern will be aligned to the world. 
AITRACKPAT_ALIGN_RANDOM 
Align the pattern randonly each time it is set. The rotation ranges are set using SetRandomRotation(). 
validationRadius 
the validation radius is added to the entity pass radius when validating the pattern along the offsets. stateTresholdMin (optional) - If the state of the pattern is 'enclosed' (high deformation) and the global deformation < stateTresholdMin, the state becomes exposed. Default 0.35. stateTresholdMax (optional) - If the state of the pattern is 'exposed' (low deformation) and the global deformation > stateTresholdMax, the state becomes enclosed. Default 0.4. globalDeformTreshold (optional) - the deformation of the whole pattern is tracked in range [0..1]. This treshold value can be used to clamp the bottom range, so that values in range [trhd..1] becomes [0..1], default 0.0. localDeformTreshold (optional) - the deformation of the each node is tracked in range [0..1]. This treshold value can be used to clamp the bottom range, so that values in range [trhd..1] becomes [0..1], default 0.0. exposureMod (optional) - the exposure modifier allows to take the node exposure (how much it is seen by the tracked target) into account when branching. The modifier should be in range [-1..1], -1 means to favor unseen nodes, and 1 means to favor seen, exposed node. Default 0 (no effect). randomRotAng (optional) - each time the pattern is set, it can be optionally rotated randomly. This parameter allows to define angles (in degrees) around each axis. The rotation is performed in XYZ order. 

Syntax: AI.BeginTrackPattern( patternName, flags, validationRadius, [stateTresholdMin], [stateTresholdMax], [globalDeformTreshold], [localDeformTreshold], [exposureMod], [randomRotAng] ) 

Begins definition of a new track pattern descriptor. The pattern is created bu calling the AI.AddPatternPoint() and AI.AddPatternBranch() functions, and finalised by calling the AI.EndTrackPattern().

AI.BeginTrackPattern( "mypattern", AITRACKPAT_VALIDATE_SWEPTSPHERE, 1.0 );

Copyright (c) 2012. All rights reserved.