GeomInterface
Class
Read time 7 minutesLast updated 8 months ago
Inheritance
Inherited Members
Namespace: UnityEngine.Pixyz.Geom
public class GeomInterface : Interface
Fields
IdentityMatrix4
public static readonly Matrix4 IdentityMatrix4
Returns
Type | Description |
|---|---|
| Matrix4 |
XupToYupMatrix4
public static readonly Matrix4 XupToYupMatrix4
Returns
Type | Description |
|---|---|
| Matrix4 |
YupToZupMatrix4
public static readonly Matrix4 YupToZupMatrix4
Returns
Type | Description |
|---|---|
| Matrix4 |
ZupToYupMatrix4
public static readonly Matrix4 ZupToYupMatrix4
Returns
Type | Description |
|---|---|
| Matrix4 |
Methods
GetLastError
public static string GetLastError()
Returns
Type | Description |
|---|---|
| string |
ApplyTransform
Apply a transformation matrix to a geometrical entity.
[HandleProcessCorruptedStateExceptions]public void ApplyTransform(uint entity, Matrix4 matrix)
Parameters
ConfigureFunctionLogger
[HandleProcessCorruptedStateExceptions]public void ConfigureFunctionLogger(string functionName, bool enableFunction, bool enableParameters, bool enableExecutionTime)
Parameters
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
Type | Description |
|---|---|
| AABB |
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
Type | Description |
|---|---|
| Matrix4 |
DecomposeTransform
Decompose a Matrix4 into translation, scale and rotation through Quaternion.
[HandleProcessCorruptedStateExceptions]public DecomposeTransformReturn DecomposeTransform(Matrix4 matrix)
Parameters
Type | Name | Description |
|---|---|---|
| Matrix4 | matrix |
Returns
Type | Description |
|---|---|
| DecomposeTransformReturn |
FromAffine
Create a Matrix from an Affine.
[HandleProcessCorruptedStateExceptions]public Matrix4 FromAffine(Affine affine)
Parameters
Type | Name | Description |
|---|---|---|
| Affine | affine | The affine. |
Returns
Type | Description |
|---|---|
| Matrix4 |
FromLookAtMatrix
Get camera position, up and target vectors.
[HandleProcessCorruptedStateExceptions]public FromLookAtMatrixReturn FromLookAtMatrix(Matrix4 matrix, double distanceFromTarget = 1)
Parameters
Returns
Type | Description |
|---|---|
| FromLookAtMatrixReturn |
FromOriginNormal
Create a Matrix from an origin and a normal vector.
[HandleProcessCorruptedStateExceptions]public Matrix4 FromOriginNormal(Point3 origin, Point3 normal)
Parameters
Returns
Type | Description |
|---|---|
| Matrix4 |
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 rotation vector (degrees). |
| Point3 | S | The scaling vector. |
Returns
Type | Description |
|---|---|
| Matrix4 |
GetMaxScale
Get maximum matrix scale.
[HandleProcessCorruptedStateExceptions]public double GetMaxScale(Matrix4 matrix)
Parameters
Type | Name | Description |
|---|---|---|
| Matrix4 | matrix |
Returns
Type | Description |
|---|---|
| double |
InvertMatrix
Invert a matrix.
[HandleProcessCorruptedStateExceptions]public Matrix4 InvertMatrix(Matrix4 matrix)
Parameters
Type | Name | Description |
|---|---|---|
| Matrix4 | matrix | The matrix to invert. |
Returns
Type | Description |
|---|---|
| Matrix4 |
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
Type | Description |
|---|---|
| Matrix4 |
MatrixToQuaternion
Get the quaternion of a Matrix4.
[HandleProcessCorruptedStateExceptions]public Point4 MatrixToQuaternion(Matrix4 matrix)
Parameters
Type | Name | Description |
|---|---|---|
| Matrix4 | matrix |
Returns
Type | Description |
|---|---|
| Point4 |
MultiplyMatrices
Multiply two matrices, returns left*right.
[HandleProcessCorruptedStateExceptions]public Matrix4 MultiplyMatrices(Matrix4 left, Matrix4 right)
Parameters
Returns
Type | Description |
|---|---|
| Matrix4 |
MultiplyMatrixPoint
Multiply a point by a matrix (i.e apply the matrix to a point).
[HandleProcessCorruptedStateExceptions]public Point3 MultiplyMatrixPoint(Matrix4 matrix, Point3 point)
Parameters
Returns
Type | Description |
|---|---|
| Point3 |
MultiplyMatrixVector
Multiply a vector by a matrix (i.e apply the matrix to a vector).
[HandleProcessCorruptedStateExceptions]public Point3 MultiplyMatrixVector(Matrix4 matrix, Point3 vector)
Parameters
Returns
Type | Description |
|---|---|
| Point3 |
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
Type | Description |
|---|---|
| Matrix4 |
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
Type | Description |
|---|---|
| Matrix4 |
QuaternionToMatrix
Returns the quaternion as a Matrix4.
[HandleProcessCorruptedStateExceptions]public Matrix4 QuaternionToMatrix(Point4 quaternion)
Parameters
Type | Name | Description |
|---|---|---|
| Point4 | quaternion |
Returns
Type | Description |
|---|---|
| Matrix4 |
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
Type | Description |
|---|---|
| Vector3List |
CreateDebugSession
[HandleProcessCorruptedStateExceptions]public void CreateDebugSession(string name)
Parameters
Type | Name | Description |
|---|---|---|
| string | name | Name of debug session. |
DestroyDebugSession
[HandleProcessCorruptedStateExceptions]public void DestroyDebugSession()
DrawDebug
[HandleProcessCorruptedStateExceptions]public void DrawDebug(uint entity)
Parameters
Type | Name | Description |
|---|---|---|
| uint | entity | The geometric entity to draw in debug mode. |
DrawDebugAABB
[HandleProcessCorruptedStateExceptions]public void DrawDebugAABB(AABB aabb, Color color)
Parameters
DrawDebugPoint
[HandleProcessCorruptedStateExceptions]public void DrawDebugPoint(Point3 point, Color color)
Parameters
DrawDebugSegment
[HandleProcessCorruptedStateExceptions]public void DrawDebugSegment(Point3 startPoint, Point3 endPoint, Color color)
Parameters
Type | Name | Description |
|---|---|---|
| Point3 | startPoint | Starting point of the segment draw. |
| Point3 | endPoint | Ending point of the segment draw. |
| Color | color | Color. |
DrawDebugTriangle
[HandleProcessCorruptedStateExceptions]public void DrawDebugTriangle(Point3 pt1, Point3 pt2, Point3 pt3, Color color)
Parameters