Polarith AI
1.8

◆ MapBySensitivity()

float MapBySensitivity ( MappingType  mapping,
Structure  structure,
Vector3  direction,
float  sensitivityOffset = 0.0f 
)
protectedinherited

Maps (magnitude) values by sensitivity so that the Structure.Sensitivity (plus the given sensitivityOffset ) is used as similarity threshold for the angle between the given direction and the Structure.Direction.

When mapping is MappingType.InverseLinear, then: the more similar the direction vectors, the greater the returned result. If the angle between the two vectors is greater than or equal to the applied threshold, then the result is 0. If the two directions are equal (which means that the angle is 0), then the result is 1. This logic can be applied analogously for the other mapping types.

Parameters
mappingDetermines the type of the used mapping function.
structureThe Structure to obtain the sensitivity and direction for.
directionThe direction which gets compared to the Structure.Direction.
sensitivityOffsetIs added to the Structure.Sensitivity as threshold.
Returns
The mapped value between 0 and 1.
Exceptions
NullReferenceExceptionIf structure is null.
Imprint