Class CachedFace
Caches the face and provides additional vector math methods.
Inheritance
Namespace: AlchemyBow.Navigation.Simple.Elements
Assembly: AlchemyBow.Navigation.dll
Syntax
public sealed class CachedFace
Constructors
| Improve this Doc View SourceCachedFace(IImmutableFace)
Creates an instance of the CachedFace class.
Declaration
public CachedFace(IImmutableFace source)
Parameters
Type | Name | Description |
---|---|---|
IImmutableFace | source | The source face. |
Fields
| Improve this Doc View Sourcea
The cached A vertex value of the source face.
Declaration
public readonly Vector3 a
Field Value
Type | Description |
---|---|
UnityEngine.Vector3 | The cached A vertex value of the source face. |
b
The cached B vertex value of the source face.
Declaration
public readonly Vector3 b
Field Value
Type | Description |
---|---|
UnityEngine.Vector3 | The cached B vertex value of the source face. |
c
The cached C vertex value of the source face.
Declaration
public readonly Vector3 c
Field Value
Type | Description |
---|---|
UnityEngine.Vector3 | The cached C vertex value of the source face. |
plane
The cached plane of the source face.
Declaration
public readonly Plane plane
Field Value
Type | Description |
---|---|
UnityEngine.Plane | The cached plane of the source face. |
source
The source face.
Declaration
public readonly IImmutableFace source
Field Value
Type | Description |
---|---|
IImmutableFace | The source face. |
Methods
| Improve this Doc View SourceCastDisplacementOnClosestEdge(Vector3, Vector3)
Casts displacement on the closest edge of the face.
Declaration
public Vector3 CastDisplacementOnClosestEdge(Vector3 current, Vector3 displacement)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | current | The current position. |
UnityEngine.Vector3 | displacement | The displacement. |
Returns
Type | Description |
---|---|
UnityEngine.Vector3 | The casted displacement. |
SnapToFace(Vector3, Vector3)
Snaps the result of the displacement to the face.
Declaration
public Vector3 SnapToFace(Vector3 current, Vector3 displacement)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector3 | current | The current position. |
UnityEngine.Vector3 | displacement | The displacement. |
Returns
Type | Description |
---|---|
UnityEngine.Vector3 | The snapped displacement result. |
Remarks
The current
must be inside the face, and displacement must point outside.