Class Fox::FXHMat

In: | FXHMat.rb
Parent: | Object

FXHMat is a 3-D homogeneous matrix.

Methods

* + - / [] det eye frustum invert left look new new new new new ortho rot rot rot scale scale scale to_s trans trans transpose xrot xrot yrot yrot zrot zrot

Public Class methods

new()

Returns a new FXHMat instance with uninitialized elements.

new(w)

Returns a new FXHMat instance with all elements initialized to w.

new(a00, a01, a02, a03, a10, a11, a12, a13, a20, a21, a22, a23, a30, a31, a32, a33)

Returns a new FXHMat instance with elements initialized by the supplied values (e.g. _a12_ is the initial value for the second row and third column).

new(a, b, c, d)

Returns a new FXHMat instance with each row initialized to the values in each of the input vectors (a, b, c and d).

new(otherMatrix)

Returns a new FXHMat instance initialized from the contents of otherMatrix.

Public Instance methods

+(other)

Returns sum of this matrix and other.

-(other)

Returns self - other.

*(x)

Returns the product of this matrix and x, where x is either another matrix or a scalar.

/(x)

Returns the result of performing an elementwise division of this matrix by x.

[](i)

Returns the ith row of this matrix (an FXHVec)

det()

Returns the determinant of this matrix

transpose()

Returns the transpose of this matrix

invert()

Returns the inversion of this matrix

to_s()

Returns the stringified version of this matrix

eye()

Set to identity matrix and return self.

ortho(left, right, bottom, top, hither, yon)

Set to orthographic projection for specified bounding box and return self.

frustum(left, right, bottom, top, hither, yon)

Set to perspective projection for specified bounding box and return self.

left()

Multiply by left-hand matrix and return self.

rot(q)

Pre-multiply this matrix by the rotation about unit-quaternion q and return self.

rot(axis, c, s)

Pre-multiply this matrix by the rotation (c, s) about axis and return self. Here, axis is a FXVec instance, c is the cosine of the angle of rotation and s is the sine of the angle of rotation.

rot(axis, phi)

Pre-multiply by a rotation of phi radians about axis (an FXVec instance) and and return self.

xrot(c, s)

Pre-multiply by rotation about the x-axis and return self. Here, c is the cosine of the angle of rotation and s is the sine of the angle of rotation.

xrot(phi)

Pre-multiply by a rotation of phi radians about the x-axis and return self.

yrot(c, s)

Pre-multiply by rotation about the y-axis and return self. Here, c is the cosine of the angle of rotation and s is the sine of the angle of rotation.

yrot(phi)

Pre-multiply by a rotation of phi radians about the y-axis and return self.

zrot(c, s)

Pre-multiply by rotation about the z-axis and return self. Here, c is the cosine of the angle of rotation and s is the sine of the angle of rotation.

zrot(phi)

Pre-multiply by a rotation of phi radians about the z-axis and return self.

look(eye, cntr, vup)

Look at and return self.

trans(tx, ty, tz)

Pre-multiply this matrix by the translation tranformation matrix T(tx, ty, tz) and return self.

trans(vec)

Pre-multiply this matrix by the translation tranformation matrix T(vec[0], vec[1], vec[2]) and return self.

scale(sx, sy, sz)

Pre-multiply by the scaling tranformation matrix S(sx, sy, sz) and return self.

scale(s)

Scale by s and return self.

scale(vec)

Pre-multiply by the scaling tranformation matrix S(sx, sy, sz) and return self.