Polarith AI
1.8
SpatialSensor Class Reference

Description

The SpatialSensor is a special type of Sensor that is applicable for general 3D scenes (back-end class).

Since there are no particular assumptions for this sensor, it can be used to control agents that are required to move in all 6 degrees of freedom like airplanes or helicopters. However, this also comes at the expense of an interpolation method.

The receptors (see class IReceptor<T>) of this sensor are placed like a sphere. This class provides two static methods used for constructing the two most common sphere topologies: CreateUvSphere(int, int, float) and CreateIcoSphere(int, float). The UV sphere has the benefit of regularly placed receptors. This property has advantages when implementing stable controllers. The icosphere, on the other hand, has a nearly equal distribution of receptors.

Attention, a sensor might be shared by multiple agents! Changing the data of a shared sensor at runtime is not thread-safe.

Back-end class of AIMSpatialSensor.

Inheritance diagram for SpatialSensor:
Sensor

Protected Fields

List< Receptorreceptors = new List<Receptor>()
 All contained receptor instances forming the shape of this sensor. More...
 

Properties

override Sensor Clone [get]
 Constructs a copy of this instance, especially deep copies the contained receptors (read only). More...
 
override Quaternion Rotation [get]
 Returns Quaternion.identity since this is a general sensor for the arbitrary 3D space (read only). More...
 
override Quaternion InverseRotation [get]
 Returns Quaternion.identity since this is a general sensor for the arbitrary 3D space (read only). More...
 
override VectorProjectionType ProjectionMode [get]
 Returns VectorProjectionType.None since this is a general sensor for the arbitrary 3D space (read only). More...
 
override int ReceptorCount [get]
 The number of contained receptors (read only). More...
 
override IReceptor< Structurethis[int id] [get]
 Provides quick read-only access to a contained Receptor instance. More...
 

Public Methods

override IReceptor< StructureAddReceptor ()
 Constructs and adds a Receptor instance into this sensor. More...
 
override IReceptor< StructureInsertReceptor (int id)
 Constructs and inserts a Receptor instance into this sensor with the specified id . More...
 
override IReceptor< StructureGetReceptor (int id)
 Gets the Receptor with the specified id . More...
 
override void RemoveReceptorAt (int id)
 Removes the Receptor with the specified id . More...
 
override void ClearReceptors ()
 Removes all contained Receptor instances. More...
 

Public Static Methods

static SpatialSensor CreateUvSphere (int segments, int rings, float radius)
 Constructs a sensor shape such that its receptors resemble a UV sphere. More...
 
static SpatialSensor CreateIcoSphere (int subdivisions, float radius)
 Constructs a sensor shape such that its receptors resemble an icosphere. More...
 
Imprint