Polarith AI
1.8

◆ StartSteering()

virtual bool StartSteering ( )
protectedvirtual

Gets called at the beginning of the context steering algorithm for each processed percept and should be used to pre-compute things like distances or to check whether a percept is relevant at all.

If a percept is not relevant, e.g. because it is too far away, this method should return false (otherwise, true) in order to force Behave to skip all further and maybe performance-heavy computations and to continue with the next percept. Furthermore, there might be some behaviours which require only this method to work properly, e.g. Align or Wander.

To improve performance, things which remain constant for one percept, e.g. central distances, can be computed in this method and re-used in PerceptSteering and ReceptorSteering. Especially for the latter, this might improve the performance a lot.

Within this method, the following references can be used for quick data access: self, percept, objective and sensor.

To make a SteeringBehaviour thread-safe, only self and percept must be accessed by writes. All other references for quick access are not thread-safe. Furthermore, to be thread-safe, no reference types of the Unity scripting API must be used within this method. If you fulfill these restrictions, you can mark the derived SteeringBehaviour class as thread-safe through setting AIMBehaviour.ThreadSafe to true for its corresponding front-end class.

Returns
true: if the processed percept is relevant for the agent, false: otherwise.

Reimplemented in Wander, Avoid, PlanarAvoidBounds, Orbit, PlanarSeekBounds, RadiusSteeringBehaviour, SeekBounds, SeekNavMesh, Pursue, Arrive, Adjust, Align, and Follow.

Imprint