Polarith AI
1.7
SteeringPercept Class Reference

Description

Implements IPercept<T> and serves as container for perceived steering data used by all derived SteeringBehaviour instances.

Instances of this class gets a SetGameObject as input and extracts all available data with the help of the Receive(GameObject) method. This is necessary for the main movement AI method Context.Evaluate to support Unity's serialization mechanism, because in sub-threads it is not possible to access class references of the Unity scripting API.

The data extraction needs to be done before the parallel execution of multiple threads, so an ideal place for this would be within an IEvaluationPreparer.PrepareEvaluation implementation respectively within AIMContext.PrepareEvaluation.

Inheritance diagram for SteeringPercept:
IPercept< GameObject >

Public Fields

readonly List< float > Values = new List<float>()
 Custom values of the received SetGameObject instance which might be set within an existing AIMSteeringTag (read only). More...
 
string Label
 User specified name for the received SetGameObject instance which might be set within an existing AIMSteeringTag. More...
 
float Significance
 Weighted importance of the received SetGameObject instance which might be set within an existing AIMSteeringTag. More...
 
float Radius
 A custom radius of the received GameObject instance which might be obtained from an existing AIMSteeringTag and used as bounding volume approximation in behaviours. More...
 
Vector3 Position
 The position of the GameObject given by the SetGameObject method. More...
 
Vector3 Scale
 The scale of the received SetGameObject instance. More...
 
Vector3 Velocity
 The velocity of the received SetGameObject instance. More...
 
Quaternion Rotation
 The rotation of the received SetGameObject instance. More...
 
Matrix4x4 WorldToLocalMatrix
 Matrix that transforms a vector from world space into the local space of this percept. More...
 
Bounds ColliderBoundsAABB
 If the received SetGameObject instance has got a Collider (or Collider2D), these are the corresponding bounds. More...
 
Bounds ColliderBoundsOBB
 If the received SetGameObject instance has got a Collider (or Collider2D), these are the corresponding bounds. More...
 
Bounds VisualBounds
 If the received SetGameObject instance has got a Sprite or Mesh, these are the corresponding bounds in local coordinates. More...
 

Properties

bool Active [get, set]
 Determines if this percept instance is active and important for an agent. More...
 
bool Received [get, set]
 A flag that indicates if the percept was already received or not. More...
 

Public Methods

virtual void Receive (GameObject gameObject)
 Extracts all information which are necessary for applying context steering algorithms from the given gameObject instance. More...
 
void Receive ()
 Calls Receive(GameObject) with the game object which has currently been assigned by SetGameObject. More...
 
virtual void Copy (SteeringPercept other)
 Deep copies the data of another SteeringPercept instance into this instance. More...
 
void Project (VectorProjectionType VectorProjection)
 Projects the vector data of this percept into the plane specified by VectorProjection . More...
 
bool IsEqual (SteeringPercept percept)
 Compares the associated game object of an other percept instance with the associated game object of this instance. More...
 
bool IsEqual (GameObject gameObject)
 Compares a gameObject with the game object associated with this percept. More...
 
bool IsNearBounds (BoundsType type, Vector3 position, float radius)
 Determines if the entity with the given position and radius is close enough to the bounds specified by type for the bounds to be relevant. More...
 
float GetBoundsSqrDistance (Vector3 point, BoundsType bounds, VectorProjectionType vectorProjection=VectorProjectionType.None)
 Returns the square distance to the bounds of this percept specified by the given bounds . More...
 
void SetGameObject (GameObject gameObject)
 Sets the associated game object which is to be used for receiving data for this percept instance. More...
 
void Receive (T data)
 Extracts arbitrary information from the given data instance. More...
 
Imprint