GeomInterface
Class
Read time 5 minutesLast updated 18 hours ago
Inheritance
Inherited Members
Namespace: UnityEngine.Pixyz.Geom
public class GeomInterface : Interface
Fields
IdentityMatrix4
public static readonly Matrix4 IdentityMatrix4
Returns
XupToYupMatrix4
public static readonly Matrix4 XupToYupMatrix4
Returns
YupToZupMatrix4
public static readonly Matrix4 YupToZupMatrix4
Returns
ZupToYupMatrix4
public static readonly Matrix4 ZupToYupMatrix4
Returns
Methods
GetLastError
public static string GetLastError()
Returns
ApplyTransform
Apply a transformation matrix to a geometrical entity.
[HandleProcessCorruptedStateExceptions]public void ApplyTransform(uint entity, Matrix4 matrix)
Parameters
Type | Name | Description |
|---|
| uint | entity | The geometric entity. |
| Matrix4 | matrix | The transformation matrix. |
ConfigureFunctionLogger
[HandleProcessCorruptedStateExceptions]public void ConfigureFunctionLogger(string functionName, bool enableFunction, bool enableParameters, bool enableExecutionTime)
Parameters
Type | Name | Description |
|---|
| string | functionName | |
| bool | enableFunction | |
| bool | enableParameters | |
| bool | enableExecutionTime | |
GetEntityAABB
Retrieve the Axis-Aligned Bounded Box of a geometric entity.
[HandleProcessCorruptedStateExceptions]public AABB GetEntityAABB(uint entity)
Parameters
Type | Name | Description |
|---|
| uint | entity | The geometric entity. |
Returns
ChangeOfBasisMatrix
Construct a Change of Basis Matrix (e.g multiplying the point [0,0,0] will result to the point origin).
[HandleProcessCorruptedStateExceptions]public Matrix4 ChangeOfBasisMatrix(Point3 origin, Point3 x, Point3 y, Point3 z)
Parameters
Type | Name | Description |
|---|
| Point3 | origin | Origin of the new basis. |
| Point3 | x | X axis of the new basis. |
| Point3 | y | Y axis of the new basis. |
| Point3 | z | Z axis of the new basis. |
Returns
FromAffine
Create a Matrix from an Affine.
[HandleProcessCorruptedStateExceptions]public Matrix4 FromAffine(Affine affine)
Parameters
Type | Name | Description |
|---|
| Affine | affine | The affine. |
Returns
FromLookAtMatrix
Get camera position, up and target vectors.
[HandleProcessCorruptedStateExceptions]public FromLookAtMatrixReturn FromLookAtMatrix(Matrix4 matrix, double distanceFromTarget = 1)
Parameters
Type | Name | Description |
|---|
| Matrix4 | matrix | The created Matrix. |
| double | distanceFromTarget | |
Returns
FromOriginNormal
Create a Matrix from an origin and a normal vector.
[HandleProcessCorruptedStateExceptions]public Matrix4 FromOriginNormal(Point3 origin, Point3 normal)
Parameters
Type | Name | Description |
|---|
| Point3 | origin | The origin point. |
| Point3 | normal | The normal vector. |
Returns
FromTRS
Create a Matrix from translation, rotation and scaling vectors.
[HandleProcessCorruptedStateExceptions]public Matrix4 FromTRS(Point3 T, Point3 R, Point3 S)
Parameters
Type | Name | Description |
|---|
| Point3 | T | The translation vector. |
| Point3 | R | The rotations vector. |
| Point3 | S | The scaling vector. |
Returns
GetMaxScale
Get maximum matrix scale.
[HandleProcessCorruptedStateExceptions]public double GetMaxScale(Matrix4 matrix)
Parameters
Returns
InvertMatrix
Invert a matrix.
[HandleProcessCorruptedStateExceptions]public Matrix4 InvertMatrix(Matrix4 matrix)
Parameters
Type | Name | Description |
|---|
| Matrix4 | matrix | The matrix to invert. |
Returns
LookAtMatrix
Create a matrix from a camera position, up and target.
[HandleProcessCorruptedStateExceptions]public Matrix4 LookAtMatrix(Point3 position, Point3 up, Point3 target)
Parameters
Type | Name | Description |
|---|
| Point3 | position | The camera position. |
| Point3 | up | The up vector. |
| Point3 | target | The target position. |
Returns
MultiplyMatrices
Multiply two matrices, returns left*right.
[HandleProcessCorruptedStateExceptions]public Matrix4 MultiplyMatrices(Matrix4 left, Matrix4 right)
Parameters
Type | Name | Description |
|---|
| Matrix4 | left | Left side matrix. |
| Matrix4 | right | Right side matrix. |
Returns
MultiplyMatrixPoint
Multiply a point by a matrix (i.e apply the matrix to a point).
[HandleProcessCorruptedStateExceptions]public Point3 MultiplyMatrixPoint(Matrix4 matrix, Point3 point)
Parameters
Type | Name | Description |
|---|
| Matrix4 | matrix | The matrix to apply. |
| Point3 | point | The point to multiply. |
Returns
MultiplyMatrixVector
Multiply a vector by a matrix (i.e apply the matrix to a vector).
[HandleProcessCorruptedStateExceptions]public Point3 MultiplyMatrixVector(Matrix4 matrix, Point3 vector)
Parameters
Type | Name | Description |
|---|
| Matrix4 | matrix | The matrix to apply. |
| Point3 | vector | The vector to multiply. |
Returns
OrthographicMatrix
Create an orthographic matrix from a 3D width, a 3D height, a near, and a far clipping distance.
[HandleProcessCorruptedStateExceptions]public Matrix4 OrthographicMatrix(double width3D, double height3D, double nearClipDistance, double farClipDistance)
Parameters
Type | Name | Description |
|---|
| double | width3D | The 3D width to consider. |
| double | height3D | The 3D height to consider. |
| double | nearClipDistance | The near clipping distance. |
| double | farClipDistance | The far clipping distance. |
Returns
PerspectiveMatrix
Create a perspective matrix from a fovX, an aspect ratio, a near, and a far clipping distance.
[HandleProcessCorruptedStateExceptions]public Matrix4 PerspectiveMatrix(double fovX, double aspectRatio, double nearClipDistance, double farClipDistance)
Parameters
Type | Name | Description |
|---|
| double | fovX | The field of view on the x axis. |
| double | aspectRatio | The aspect ratio foxX/fovY. |
| double | nearClipDistance | The near clipping distance. |
| double | farClipDistance | The far clipping distance. |
Returns
ToTRS
Decompose a Matrix into translation, rotation and scaling vectors.
[HandleProcessCorruptedStateExceptions]public Vector3List ToTRS(Matrix4 matrix)
Parameters
Type | Name | Description |
|---|
| Matrix4 | matrix | The Matrix to be decomposed. |
Returns