A* Pathfinding Project  4.1.20
The A* Pathfinding Project for Unity 3D
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events Macros Groups Pages
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)
 
void CopyTo (MutableGraphTransform graphTransform)
 Copies the data in this transform to another mutable graph transform.
 
Vector3 InverseTransform (Vector3 point)
 
Int3 InverseTransform (Int3 point)
 
void InverseTransform (Int3[] arr)
 
Bounds InverseTransform (Bounds bounds)
 
Vector3 Transform (Vector3 point)
 
void Transform (Int3[] arr)
 
void Transform (Vector3[] arr)
 
Bounds Transform (Bounds bounds)
 
Vector3 TransformVector (Vector3 point)
 
Vector3 WorldUpAtGraphPosition (Vector3 point)
 
- Public Member Functions inherited from IMovementPlane
void CopyTo (SimpleMovementPlane plane)
 
Vector2 ToPlane (Vector3 p)
 
Vector2 ToPlane (Vector3 p, out float elevation)
 
Vector3 ToWorld (Vector2 p, float elevation=0)
 
- Public Member Functions inherited from ITransform
Vector3 InverseTransform (Vector3 position)
 
Vector3 Transform (Vector3 position)
 

Static Public Member Functions

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

Static Public Attributes

static readonly GraphTransform identityTransform = new GraphTransform(Matrix4x4.identity)
 
static readonly GraphTransform xyPlane = new GraphTransform(Matrix4x4.TRS(Vector3.zero, Quaternion.Euler(-90, 0, 0), Vector3.one))
 Transforms from the XZ plane to the XY plane.
 
static readonly GraphTransform xzPlane = new GraphTransform(Matrix4x4.identity)
 Transforms from the XZ plane to the XZ plane (i.e.
 

Protected Member Functions

void Set (Matrix4x4 matrix)
 

Properties

bool identity [get]
 True if this transform is the identity transform (i.e it does not do anything)
 
bool onlyTranslational [get]
 True if this transform is a pure translation without any scaling or rotation.
 

Private Member Functions

void IMovementPlane. CopyTo (SimpleMovementPlane plane)
 
Vector2 IMovementPlane. ToPlane (Vector3 point)
 Transforms from world space to the 'ground' plane of the graph.
 
Vector2 IMovementPlane. ToPlane (Vector3 point, out float elevation)
 Transforms from world space to the 'ground' plane of the graph.
 
Vector3 IMovementPlane. ToWorld (Vector2 point, float elevation)
 Transforms from the 'ground' plane of the graph to world space.
 

Static Private Member Functions

static bool MatrixIsTranslational (Matrix4x4 matrix)
 

Private Attributes

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

Constructor & Destructor Documentation

GraphTransform ( Matrix4x4  matrix)

Member Function Documentation

void IMovementPlane. CopyTo ( SimpleMovementPlane  plane)
private
void CopyTo ( MutableGraphTransform  graphTransform)

Copies the data in this transform to another mutable graph transform.

Vector3 InverseTransform ( Vector3  point)
Int3 InverseTransform ( Int3  point)
void InverseTransform ( Int3[]  arr)
Bounds InverseTransform ( Bounds  bounds)
static bool MatrixIsTranslational ( Matrix4x4  matrix)
staticprivate
static GraphTransform operator* ( GraphTransform  lhs,
Matrix4x4  rhs 
)
static
static GraphTransform operator* ( Matrix4x4  lhs,
GraphTransform  rhs 
)
static
void Set ( Matrix4x4  matrix)
protected
Vector2 IMovementPlane. ToPlane ( Vector3  point)
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).

Vector2 IMovementPlane. ToPlane ( Vector3  point,
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.

Vector3 IMovementPlane. ToWorld ( Vector2  point,
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.

Vector3 Transform ( Vector3  point)
void Transform ( Int3[]  arr)
void Transform ( Vector3[]  arr)
Bounds Transform ( Bounds  bounds)
Vector3 TransformVector ( Vector3  point)
Vector3 WorldUpAtGraphPosition ( Vector3  point)

Member Data Documentation

Int3 i3translation
private
readonly GraphTransform identityTransform = new GraphTransform(Matrix4x4.identity)
static
Matrix4x4 inverseMatrix
private
Quaternion inverseRotation
private
bool isIdentity
private
bool isOnlyTranslational
private
bool isXY
private
bool isXZ
private
Matrix4x4 matrix
private
Quaternion rotation
private
Vector3 translation
private
Vector3 up
private
readonly GraphTransform xyPlane = new GraphTransform(Matrix4x4.TRS(Vector3.zero, Quaternion.Euler(-90, 0, 0), Vector3.one))
static

Transforms from the XZ plane to the XY plane.

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

Transforms from the XZ plane to the XZ plane (i.e.

an identity transformation)

Property Documentation

bool identity
get

True if this transform is the identity transform (i.e it does not do anything)

bool onlyTranslational
get

True if this transform is a pure translation without any scaling or rotation.


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