A* Pathfinding Project  4.1.7
The A* Pathfinding Project for Unity 3D
GraphTransform Class Reference

Defines a transformation from graph space to world space. More...

Detailed Description

Defines a transformation from graph space to world space.

This is essentially just a simple wrapper around a matrix, but it has several utilities that are useful.

Public Member Functions

 GraphTransform (Matrix4x4 matrix)
 
Vector3 InverseTransform (Vector3 p)
 
Int3 InverseTransform (Int3 p)
 
void InverseTransform (Int3[] arr)
 
Bounds InverseTransform (Bounds b)
 
Vector3 Transform (Vector3 p)
 
void Transform (Int3[] arr)
 
void Transform (Vector3[] arr)
 
Bounds Transform (Bounds b)
 
Vector3 TransformVector (Vector3 p)
 
Vector3 WorldUpAtGraphPosition (Vector3 p)
 

Static Public Member Functions

static GraphTransform operator* (GraphTransform lhs, Matrix4x4 rhs)
 
static GraphTransform operator* (Matrix4x4 lhs, GraphTransform rhs)
 

Public Attributes

readonly bool identity
 
readonly bool onlyTranslational
 

Static Public Attributes

static readonly GraphTransform identityTransform = new GraphTransform(Matrix4x4.identity)
 

Private Member Functions

Vector2 IMovementPlane. ToPlane (Vector3 p)
 Transforms from world space to the 'ground' plane of the graph. More...
 
Vector2 IMovementPlane. ToPlane (Vector3 p, out float elevation)
 Transforms from world space to the 'ground' plane of the graph. More...
 
Vector3 IMovementPlane. ToWorld (Vector2 p, float elevation)
 Transforms from the 'ground' plane of the graph to world space. More...
 

Static Private Member Functions

static bool MatrixIsTranslational (Matrix4x4 m)
 

Private Attributes

readonly Int3 i3translation
 
readonly Matrix4x4 inverseMatrix
 
readonly Quaternion inverseRotation
 
readonly bool isXY
 
readonly bool isXZ
 
readonly Matrix4x4 matrix
 
readonly Quaternion rotation
 
readonly Vector3 translation
 
readonly Vector3 up
 

Constructor & Destructor Documentation

◆ GraphTransform()

GraphTransform ( Matrix4x4  matrix)

Member Function Documentation

◆ InverseTransform() [1/4]

Vector3 InverseTransform ( Vector3  p)

Implements ITransform.

◆ InverseTransform() [2/4]

Int3 InverseTransform ( Int3  p)

◆ InverseTransform() [3/4]

void InverseTransform ( Int3 []  arr)

◆ InverseTransform() [4/4]

Bounds InverseTransform ( Bounds  b)

◆ MatrixIsTranslational()

static bool MatrixIsTranslational ( Matrix4x4  m)
staticprivate

◆ operator*() [1/2]

static GraphTransform operator* ( GraphTransform  lhs,
Matrix4x4  rhs 
)
static

◆ operator*() [2/2]

static GraphTransform operator* ( Matrix4x4  lhs,
GraphTransform  rhs 
)
static

◆ ToPlane() [1/2]

Vector2 IMovementPlane. ToPlane ( Vector3  p)
private

Transforms from world space to the 'ground' plane of the graph.

The transformation is purely a rotation so no scale or offset is used.

For a graph rotated with the rotation (-90, 0, 0) this will transform a coordinate (x,y,z) to (x,y). For a graph with the rotation (0,0,0) this will tranform a coordinate (x,y,z) to (x,z). More generally for a graph with a quaternion rotation R this will transform a vector V to R * V (i.e rotate the vector V using the rotation R).

Implements IMovementPlane.

◆ ToPlane() [2/2]

Vector2 IMovementPlane. ToPlane ( Vector3  p,
out float  elevation 
)
private

Transforms from world space to the 'ground' plane of the graph.

The transformation is purely a rotation so no scale or offset is used.

Implements IMovementPlane.

◆ ToWorld()

Vector3 IMovementPlane. ToWorld ( Vector2  p,
float  elevation 
)
private

Transforms from the 'ground' plane of the graph to world space.

The transformation is purely a rotation so no scale or offset is used.

Implements IMovementPlane.

◆ Transform() [1/4]

Vector3 Transform ( Vector3  p)

Implements ITransform.

◆ Transform() [2/4]

void Transform ( Int3 []  arr)

◆ Transform() [3/4]

void Transform ( Vector3 []  arr)

◆ Transform() [4/4]

Bounds Transform ( Bounds  b)

◆ TransformVector()

Vector3 TransformVector ( Vector3  p)

◆ WorldUpAtGraphPosition()

Vector3 WorldUpAtGraphPosition ( Vector3  p)

Member Data Documentation

◆ i3translation

readonly Int3 i3translation
private

◆ identity

readonly bool identity

◆ identityTransform

readonly GraphTransform identityTransform = new GraphTransform(Matrix4x4.identity)
static

◆ inverseMatrix

readonly Matrix4x4 inverseMatrix
private

◆ inverseRotation

readonly Quaternion inverseRotation
private

◆ isXY

readonly bool isXY
private

◆ isXZ

readonly bool isXZ
private

◆ matrix

readonly Matrix4x4 matrix
private

◆ onlyTranslational

readonly bool onlyTranslational

◆ rotation

readonly Quaternion rotation
private

◆ translation

readonly Vector3 translation
private

◆ up

readonly Vector3 up
private

The documentation for this class was generated from the following file: