graphene.matrix

Module for [Matrix] class

class Matrix

Types 1

A structure capable of holding a 4x4 matrix.

The contents of the #graphene_matrix_t structure are private and should never be accessed directly.

Methods
void * _cPtr(Flag!"Dup" dup = No.Dup)
GType _gType() @property
Matrix self()Returns `this`, for use in `with` statements.
graphene.matrix.Matrix alloc()Allocates a new #graphenematrixt. Returns: the newly allocated matrix
bool decompose(out graphene.vec3.Vec3 translate, out graphene.vec3.Vec3 scale, out graphene.quaternion.Quaternion rotate, out graphene.vec3.Vec3 shear, out graphene.vec4.Vec4 perspective)Decomposes a transformation matrix into its component transformations.
float determinant()Computes the determinant of the given matrix. Returns: the value of the determinant
bool equal(graphene.matrix.Matrix b)Checks whether the two given #graphenematrixt matrices are equal.
bool equalFast(graphene.matrix.Matrix b)Checks whether the two given #graphenematrixt matrices are byte-by-byte equal.
void getRow(uint index, out graphene.vec4.Vec4 res)Retrieves the given row vector at index_ inside a matrix.
float getValue(uint row, uint col)Retrieves the value at the given row and col index.
float getXScale()Retrieves the scaling factor on the X axis in `m`. Returns: the value of the scaling factor
float getXTranslation()Retrieves the translation component on the X axis from `m`. Returns: the translation component
float getYScale()Retrieves the scaling factor on the Y axis in `m`. Returns: the value of the scaling factor
float getYTranslation()Retrieves the translation component on the Y axis from `m`. Returns: the translation component
float getZScale()Retrieves the scaling factor on the Z axis in `m`. Returns: the value of the scaling factor
float getZTranslation()Retrieves the translation component on the Z axis from `m`. Returns: the translation component
graphene.matrix.Matrix initFrom2d(double xx, double yx, double xy, double yy, double x0, double y0)Initializes a #graphenematrixt from the values of an affine transformation matrix.
graphene.matrix.Matrix initFromFloat(float[] v)Initializes a #graphenematrixt with the given array of floating point values.
graphene.matrix.Matrix initFromMatrix(graphene.matrix.Matrix src)Initializes a #graphenematrixt using the values of the given matrix.
graphene.matrix.Matrix initFromVec4(graphene.vec4.Vec4 v0, graphene.vec4.Vec4 v1, graphene.vec4.Vec4 v2, graphene.vec4.Vec4 v3)Initializes a #graphenematrixt with the given four row vectors.
graphene.matrix.Matrix initFrustum(float left, float right, float bottom, float top, float zNear, float zFar)Initializes a #graphenematrixt compatible with #graphenefrustumt.
graphene.matrix.Matrix initIdentity()Initializes a #graphenematrixt with the identity matrix. Returns: the initialized matrix
graphene.matrix.Matrix initLookAt(graphene.vec3.Vec3 eye, graphene.vec3.Vec3 center, graphene.vec3.Vec3 up)Initializes a #graphenematrixt so that it positions the "camera" at the given eye coordinates towards an object at the center coordinates. The top of the camera is aligned to the direction of the u...
graphene.matrix.Matrix initOrtho(float left, float right, float top, float bottom, float zNear, float zFar)Initializes a #graphenematrixt with an orthographic projection.
graphene.matrix.Matrix initPerspective(float fovy, float aspect, float zNear, float zFar)Initializes a #graphenematrixt with a perspective projection.
graphene.matrix.Matrix initRotate(float angle, graphene.vec3.Vec3 axis)Initializes `m` to represent a rotation of angle degrees on the axis represented by the axis vector.
graphene.matrix.Matrix initScale(float x, float y, float z)Initializes a #graphenematrixt with the given scaling factors.
graphene.matrix.Matrix initSkew(float xSkew, float ySkew)Initializes a #graphenematrixt with a skew transformation with the given factors.
graphene.matrix.Matrix initTranslate(graphene.point3_d.Point3D p)Initializes a #graphenematrixt with a translation to the given coordinates.
void interpolate(graphene.matrix.Matrix b, double factor, out graphene.matrix.Matrix res)Linearly interpolates the two given #graphenematrixt by interpolating the decomposed transformations separately.
bool inverse(out graphene.matrix.Matrix res)Inverts the given matrix.
bool is2d()Checks whether the given #graphenematrixt is compatible with an a 2D affine transformation matrix. Returns: `true` if the matrix is compatible with an affine transformation matrix
bool isBackfaceVisible()Checks whether a #graphenematrixt has a visible back face. Returns: `true` if the back face of the matrix is visible
bool isIdentity()Checks whether the given #graphenematrixt is the identity matrix. Returns: `true` if the matrix is the identity matrix
bool isSingular()Checks whether a matrix is singular. Returns: `true` if the matrix is singular
void multiply(graphene.matrix.Matrix b, out graphene.matrix.Matrix res)Multiplies two #graphenematrixt.
bool near(graphene.matrix.Matrix b, float epsilon)Compares the two given #graphenematrixt matrices and checks whether their values are within the given epsilon of each other.
void normalize(out graphene.matrix.Matrix res)Normalizes the given #graphenematrixt.
void perspective(float depth, out graphene.matrix.Matrix res)Applies a perspective of depth to the matrix.
void print()Prints the contents of a matrix to the standard error stream.
void projectPoint(graphene.point.Point p, out graphene.point.Point res)Projects a #graphenepointt using the matrix `m`.
void projectRect(graphene.rect.Rect r, out graphene.quad.Quad res)Projects all corners of a #graphenerectt using the given matrix.
void projectRectBounds(graphene.rect.Rect r, out graphene.rect.Rect res)Projects a #graphenerectt using the given matrix.
void rotate(float angle, graphene.vec3.Vec3 axis)Adds a rotation transformation to `m`, using the given angle and axis vector.
void rotateEuler(graphene.euler.Euler e)Adds a rotation transformation to `m`, using the given #grapheneeulert.
void rotateQuaternion(graphene.quaternion.Quaternion q)Adds a rotation transformation to `m`, using the given #graphenequaterniont.
void rotateX(float angle)Adds a rotation transformation around the X axis to `m`, using the given angle.
void rotateY(float angle)Adds a rotation transformation around the Y axis to `m`, using the given angle.
void rotateZ(float angle)Adds a rotation transformation around the Z axis to `m`, using the given angle.
void scale(float factorX, float factorY, float factorZ)Adds a scaling transformation to `m`, using the three given factors.
void skewXy(float factor)Adds a skew of factor on the X and Y axis to the given matrix.
void skewXz(float factor)Adds a skew of factor on the X and Z axis to the given matrix.
void skewYz(float factor)Adds a skew of factor on the Y and Z axis to the given matrix.
bool to2d(out double xx, out double yx, out double xy, out double yy, out double x0, out double y0)Converts a #graphenematrixt to an affine transformation matrix, if the given matrix is compatible.
void toFloat(ref float[] v)Converts a #graphenematrixt to an array of floating point values.
void transformBounds(graphene.rect.Rect r, out graphene.rect.Rect res)Transforms each corner of a #graphenerectt using the given matrix `m`.
void transformBox(graphene.box.Box b, out graphene.box.Box res)Transforms the vertices of a #grapheneboxt using the given matrix `m`.
void transformPoint(graphene.point.Point p, out graphene.point.Point res)Transforms the given #graphenepointt using the matrix `m`.
void transformPoint3d(graphene.point3_d.Point3D p, out graphene.point3_d.Point3D res)Transforms the given #graphenepoint3dt using the matrix `m`.
void transformRay(graphene.ray.Ray r, out graphene.ray.Ray res)Transform a #graphenerayt using the given matrix `m`.
void transformRect(graphene.rect.Rect r, out graphene.quad.Quad res)Transforms each corner of a #graphenerectt using the given matrix `m`.
void transformSphere(graphene.sphere.Sphere s, out graphene.sphere.Sphere res)Transforms a #graphenespheret using the given matrix `m`. The result is the bounding sphere containing the transformed sphere.
void transformVec3(graphene.vec3.Vec3 v, out graphene.vec3.Vec3 res)Transforms the given #graphenevec3t using the matrix `m`.
void transformVec4(graphene.vec4.Vec4 v, out graphene.vec4.Vec4 res)Transforms the given #graphenevec4t using the matrix `m`.
void translate(graphene.point3_d.Point3D pos)Adds a translation transformation to `m` using the coordinates of the given #graphenepoint3dt.
void transpose(out graphene.matrix.Matrix res)Transposes the given matrix.
void unprojectPoint3d(graphene.matrix.Matrix modelview, graphene.point3_d.Point3D point, out graphene.point3_d.Point3D res)Unprojects the given point using the projection matrix and a modelview matrix.
void untransformBounds(graphene.rect.Rect r, graphene.rect.Rect bounds, out graphene.rect.Rect res)Undoes the transformation on the corners of a #graphenerectt using the given matrix, within the given axis aligned rectangular bounds.
bool untransformPoint(graphene.point.Point p, graphene.rect.Rect bounds, out graphene.point.Point res)Undoes the transformation of a #graphenepointt using the given matrix, within the given axis aligned rectangular bounds.
Constructors
this()Create a `matrix.Matrix` boxed type.
this(void * ptr, Flag!"Take" take)