State machine

The state machine module builds a state machine network for the group agents. It also handles state changes during the simulation.



Attributes

AttributesTypeOverridableDescription
behave3dboolnoIf true, the agents will move freely in 3D as if they were particles.
fixLegStretchboolnoIf true, compensate the leg stretching.
frameRatestringyesThe frame rate used for playing the agent animation.
gravityField

string

noThe name of the gravity field.
heightFieldstringnoThe name of the height field.
heightFieldOffsetdoublenoAn extra offset applied to your agent heights from the ground.
seedintnoSeed random value.
startFramedoubleyesThe start frame of the state machine clips. If set to a value lower than 0, a random value is used instead.
frameOffsetintyesA frame offset
stateintyesThe current state.
debugboolnoEnables module debug drawing.
stateRandomDelayvector2yesThis attribute accept a range (by default is 0,0). If you put a range of 5, 20 then every agent will have a random delay between 5 to 20 frames when changing state. If you want a specific delay without the random, use the same value in both the vector components, i.e. 5,5.
adjustHeightOnAgentCreationOnlyboolnoIf on, the agent heights are adapted only on the first frame.
rayCastGravityFieldboolnoIf set to true samples the gravity field using a ray cast, otherwise it uses the closest point
setStateOnAgentCreationOnlyboolnoSets the state on agent creation only
setFrameRateOnAgentCreationOnlyboolnoSets the frame rate on agent creation only
allowPathSearchboolnoif on, the state machine will search a path to reach the new state if it is not directly connected to the current state. If a path is found all the states in between are played as well as the new state.
disableFootLockboolyesDisables the foot lock
maxUpAxisAngledoubleyesMaximum up axis rotation angle in degrees
alignUpAxisTresholdAngledoubleyesThreshold angle used to realign the agent up axis with the global up axis
sitAdaptationboolyesIf on, the agent will adapt to the height field when playing sitting clips. The sitting factor must be properly configured for the clip being played.
softIkDistancedoubleyesThe soft ik distance used by the IK algorithm. Set this value to 0 to disable the soft IK.
maxAngularAccelerationdoubleyesMaximum angular acceleration per frame (degrees). Only used with Locomotion states.
maxLinearAccelerationdoubleyesMaximum linear acceleration per frame. Only used with Locomotion states.
angularAverageNumFramesintyesNumber of frames used to compute the angular velocity as the average of the previous n values. Only used with Locomotion states.
linearAverageNumFramesintyesNumber of frames used to compute the linear velocity as the average of the previous n values. Only used with Locomotion states.
forceUnsyncedClipsboolyesIf on, the module will play unsynced clip if the linear and angular velocities of the current frame match one (the average is ignored). Only used with Locomotion states.
disableFootLockOnLegStretchboolyesDisables the foot lock when leg stretches too much compared to the bind leg length.
legStretchMaxRatiodoubleyesWhen disableFootLockOnLegStretch is on, this value provides the maximum ratio between the current leg length and the bind leg length. The foot lock is disabled when the ratio is greater than the given value.


Copyright © 2017, Toolchefs LTD.