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
-
mapping | Determines the type of the used mapping function. |
structure | The Structure to obtain the sensitivity and direction for. |
direction | The direction which gets compared to the Structure.Direction. |
sensitivityOffset | Is added to the Structure.Sensitivity as threshold. |
- Returns
- The mapped value between 0 and 1.
- Exceptions
-
NullReferenceException | If structure is null . |