Class Geom
- Namespace
Methods
applyTransform
Apply a transformation matrix to a geometrical entity
geom.applyTransform(entity, matrix=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]])
Parameters
entity
GeomEntityThe geometric entity
matrix
Matrix4The transformation matrix
configureFunctionLogger
geom.configureFunctionLogger(functionName, enableFunction, enableParameters, enableExecutionTime)
Parameters
getEntityAABB
Retrieve the Axis-Aligned Bounded Box of a geometric entity
geom.getEntityAABB(entity) -> geom.AABB
Parameters
entity
GeomEntityThe geometric entity
Returns
- AABB
The axis aligned bounded box
changeOfBasisMatrix
Construct a Change of Basis Matrix (e.g multiplying the point [0,0,0] will result to the point origin)
See also:
geom.changeOfBasisMatrix(origin, x, y, z) -> geom.Matrix4
Parameters
origin
Point3Origin of the new basis
x
Vector3X axis of the new basis
y
Vector3Y axis of the new basis
z
Vector3Z axis of the new basis
Returns
- Matrix4
The change of basis matrix
fromAffine
Create a Matrix from an Affine
See also:
geom.fromAffine(affine) -> geom.Matrix4
Parameters
affine
AffineThe affine
Returns
- Matrix4
The created Matrix
fromLookAtMatrix
Get camera position, up and target vectors
See also:
geom.fromLookAtMatrix(matrix, distanceFromTarget) -> geom.Point3, geom.Vector3, geom.Point3
Parameters
Returns
- Point3
The camera position
fromOriginNormal
Create a Matrix from an origin and a normal vector
See also:
geom.fromOriginNormal(origin, normal) -> geom.Matrix4
Parameters
Returns
- Matrix4
The created Matrix
fromTRS
Create a Matrix from translation, rotation and scaling vectors
See also:
geom.fromTRS(T, R, S) -> geom.Matrix4
Parameters
Returns
- Matrix4
The created Matrix
invertMatrix
Invert a matrix
See also:
geom.invertMatrix(matrix) -> geom.Matrix4
Parameters
matrix
Matrix4The matrix to invert
Returns
- Matrix4
The inverted matrix
lookAtMatrix
Create a matrix from a camera position, up and target
See also:
geom.lookAtMatrix(position, up, target) -> geom.Matrix4
Parameters
Returns
- Matrix4
The created matrix
multiplyMatrices
Multiply two matrices, returns left*right
See also:
geom.multiplyMatrices(left, right) -> geom.Matrix4
Parameters
Returns
- Matrix4
Result of the matrices multiplication
multiplyMatrixPoint
Multiply a point by a matrix (i.e apply the matrix to a point)
See also:
geom.multiplyMatrixPoint(matrix, point) -> geom.Point3
Parameters
Returns
- Point3
The resulting point
multiplyMatrixVector
Multiply a vector by a matrix (i.e apply the matrix to a vector)
See also:
geom.multiplyMatrixVector(matrix, vector) -> geom.Vector3
Parameters
Returns
- Vector3
The resulting point
orthographicMatrix
Create an orthographic matrix from a 3D width, a 3D height, a near, and a far clipping distance
See also:
geom.orthographicMatrix(width3D, height3D, nearClipDistance, farClipDistance) -> geom.Matrix4
Parameters
width3D
DoubleThe 3D width to consider
height3D
DoubleThe 3D height to consider
nearClipDistance
DistanceThe near clipping distance
farClipDistance
DistanceThe far clipping distance
Returns
- Matrix4
The created matrix
perspectiveMatrix
Create a perspective matrix from a fovX, an aspect ratio, a near, and a far clipping distance
See also:
geom.perspectiveMatrix(fovX, aspectRatio, nearClipDistance, farClipDistance) -> geom.Matrix4
Parameters
fovX
AngleThe field of view on the x axis
aspectRatio
DoubleThe aspect ratio foxX/fovY
nearClipDistance
DistanceThe near clipping distance
farClipDistance
DistanceThe far clipping distance
Returns
- Matrix4
The created matrix
toTRS
Decompose a Matrix into translation, rotation and scaling vectors
See also:
geom.toTRS(matrix) -> geom.Vector3List
Parameters
matrix
Matrix4The Matrix to be decomposed
Returns
- Vector3List
The TRS list