UNPKG

hytopia

Version:

The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.

460 lines (202 loc) 5.56 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [server](./server.md) &gt; [Matrix3](./server.matrix3.md) ## Matrix3 class Represents a 3x3 matrix. **Signature:** ```typescript export default class Matrix3 extends Float32Array ``` **Extends:** Float32Array ## Remarks All matrix methods result in mutation of the matrix instance. This class extends `Float32Array` to provide an efficient way to create and manipulate a 3x3 matrix. Various convenience methods are provided for common matrix operations. ## Constructors <table><thead><tr><th> Constructor </th><th> Modifiers </th><th> Description </th></tr></thead> <tbody><tr><td> [(constructor)(m00, m01, m02, m10, m11, m12, m20, m21, m22)](./server.matrix3._constructor_.md) </td><td> </td><td> Constructs a new instance of the `Matrix3` class </td></tr> </tbody></table> ## Properties <table><thead><tr><th> Property </th><th> Modifiers </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td> [determinant](./server.matrix3.determinant.md) </td><td> `readonly` </td><td> number </td><td> The determinant of the matrix. </td></tr> <tr><td> [frobeniusNorm](./server.matrix3.frobeniusnorm.md) </td><td> `readonly` </td><td> number </td><td> The frobenius norm of the matrix. </td></tr> </tbody></table> ## Methods <table><thead><tr><th> Method </th><th> Modifiers </th><th> Description </th></tr></thead> <tbody><tr><td> [add(matrix3)](./server.matrix3.add.md) </td><td> </td><td> Adds a matrix to the current matrix. </td></tr> <tr><td> [adjoint()](./server.matrix3.adjoint.md) </td><td> </td><td> Sets the adjugate of the current matrix. </td></tr> <tr><td> [clone()](./server.matrix3.clone.md) </td><td> </td><td> Clones the current matrix. </td></tr> <tr><td> [copy(matrix3)](./server.matrix3.copy.md) </td><td> </td><td> Copies a matrix to the current matrix. </td></tr> <tr><td> [create()](./server.matrix3.create.md) </td><td> `static` </td><td> Creates a new `Matrix3` instance. </td></tr> <tr><td> [equals(matrix3)](./server.matrix3.equals.md) </td><td> </td><td> Checks if the current matrix is approximately equal to another matrix. </td></tr> <tr><td> [exactEquals(matrix3)](./server.matrix3.exactequals.md) </td><td> </td><td> Checks if the current matrix is exactly equal to another matrix. </td></tr> <tr><td> [fromMatrix4(matrix4)](./server.matrix3.frommatrix4.md) </td><td> `static` </td><td> Creates a new `Matrix3` instance from a `Matrix4` instance. </td></tr> <tr><td> [fromQuaternion(quaternion)](./server.matrix3.fromquaternion.md) </td><td> `static` </td><td> Creates a new `Matrix3` instance from a `Quaternion` instance. </td></tr> <tr><td> [fromRotation(angle)](./server.matrix3.fromrotation.md) </td><td> `static` </td><td> Creates a new `Matrix3` instance from a rotation of identity matrix. </td></tr> <tr><td> [fromScaling(scale)](./server.matrix3.fromscaling.md) </td><td> `static` </td><td> Creates a new `Matrix3` instance from a scale of identity matrix. </td></tr> <tr><td> [fromTranslation(translation)](./server.matrix3.fromtranslation.md) </td><td> `static` </td><td> Creates a new `Matrix3` instance from a translation of identity matrix. This is used only when working with two-dimensional homogeneous coordinates, which is why the `translation` parameter is a `Vector2`<!-- -->. </td></tr> <tr><td> [identity()](./server.matrix3.identity.md) </td><td> </td><td> Sets the current matrix to the identity matrix. </td></tr> <tr><td> [invert()](./server.matrix3.invert.md) </td><td> </td><td> Inverts the current matrix. </td></tr> <tr><td> [multiply(matrix3)](./server.matrix3.multiply.md) </td><td> </td><td> Multiplies the current matrix by another matrix. </td></tr> <tr><td> [multiplyScalar(scalar)](./server.matrix3.multiplyscalar.md) </td><td> </td><td> Multiplies each element of the current matrix by a scalar value. </td></tr> <tr><td> [projection(width, height)](./server.matrix3.projection.md) </td><td> </td><td> Sets the current matrix to a orthographic projection matrix with the given bounds. </td></tr> <tr><td> [rotate(angle)](./server.matrix3.rotate.md) </td><td> </td><td> Rotates the current matrix by an angle in radians. </td></tr> <tr><td> [subtract(matrix3)](./server.matrix3.subtract.md) </td><td> </td><td> Subtracts a matrix from the current matrix. </td></tr> <tr><td> [toString()](./server.matrix3.tostring.md) </td><td> </td><td> Returns a string representation of the current matrix. </td></tr> <tr><td> [transformVector(vector)](./server.matrix3.transformvector.md) </td><td> </td><td> Multiplies the provided vector3 by this matrix. This modifies the vector in-place, but also returns the transformed vector. </td></tr> <tr><td> [transpose()](./server.matrix3.transpose.md) </td><td> </td><td> Transposes the current matrix. </td></tr> </tbody></table>