xhookLua
Game

Matrix3x4

3x4 bone-layout transform: 3x3 rotation, translation in column 3, 0-based indices.

Methods

Matrix3x4

Matrix3x4([m00, m01, m02, m03, m10, ..., m23]) -> Matrix3x4
NameTypeDescription
m00..m23optionalnumber12 numbers, row-major. Default identity.

Builds from 12 numbers, otherwise the identity.

1 to 11 numbers silently give the identity.

Matrix3x4.from_angles

Matrix3x4.from_angles(angles [, origin]) -> Matrix3x4
NameTypeDescription
anglesAnglePitch, yaw, roll in degrees.
originoptionalVectorColumn 3; non-Vectors ignored. Default Vector(0,0,0).

Rotation plus translation matrix, like the engine's AngleMatrix.

m:get

m:get(row, col) -> number
NameTypeDescription
rowinteger0 to 2.
colinteger0 to 3.

Reads one element.

Out-of-range row or column raises an error.

m:set

m:set(row, col, value)
NameTypeDescription
rowinteger0 to 2.
colinteger0 to 3.
valuenumber

Writes one element in place.

Out-of-range row or column raises an error.

m:origin

m:origin() -> Vector

Position part, like a bone's world position.

Returns Column 3 (translation)

m:forward

m:forward() -> Vector

Forward axis.

Returns Column 0

m:right

m:right() -> Vector

Right axis; the engine's column 1 points left.

Returns Negated column 1

m:up

m:up() -> Vector

Up axis.

Returns Column 2

m:transform

m:transform(point) -> Vector
NameTypeDescription
pointVectorPoint in local space.

Rotates and translates a local point.

m:rotate

m:rotate(v) -> Vector
NameTypeDescription
vVectorDirection vector.

Rotation only, no translation; use for directions.

tostring(m)

tostring(m) -> string

Readable form with forward axis and origin.

Returns "Matrix3x4[fwd=(x,y,z) org=(x,y,z)]"

Matrix3x4 ยท Lua API ยท xhook