Documentation

Want to improve the docs? Take a look at scripting-api-data!
Found a bug? jc3mp/bugs is a good place to let us know.

Matrix

Constructible This class can be instantiated from your script. You can find more information on the Constructor below. Auto Destroy Instances of this class will be deleted automatically. Custom Properties You cannot add your own properties to instances of this class. They will not be saved and can cause undefined behavior.

Constructor

new Matrix()

Example

var matrix = new Matrix();

Properties

Name Type Description
position Vector3f read only the Matrix's position in the game world

Functions

Matrix.Transpose()

returns: Matrix

Matrix.Scale(Vector3f scale)

returns: Matrix

Parameter

Name Type Description
scale Vector3f

Matrix.Rotate(number factor, Vector3f rotation)

returns: Matrix

Parameter

Name Type Description
factor number
rotation Vector3f

Matrix.Translate(Vector3f translation)

returns: Matrix

Parameter

Name Type Description
translation Vector3f

Matrix.LookAt(Vector3f p1, Vector3f p2, Vector3f p3)

returns: Matrix

Parameter

Name Type Description
p1 Vector3f
p2 Vector3f
p3 Vector3f

Matrix.mul(Matrix p1)

returns: Matrix

Parameter

Name Type Description
p1 Matrix

Matrix.div(Matrix p1)

returns: Matrix

Parameter

Name Type Description
p1 Matrix

Matrix.sub(Matrix p1)

returns: Matrix

Parameter

Name Type Description
p1 Matrix

Matrix.add(Matrix p1)

returns: Matrix

Parameter

Name Type Description
p1 Matrix

Stay informed

By becoming the newest member of our growing forums, we and hundreds of other players will always keep you up to date on everything JC3:MP related.