BlitzMax

BlitzMax

  • Downloads
  • Docs
  • API
  • Resources
  • About

›BRL.Matrix

BRL.Matrix

  • SMat2
  • SMat2F
  • SMat2I
  • SMat3
  • SMat3F
  • SMat3I
  • SMat4
  • SMat4F
  • SMat4I
Edit

SMat4

A standard 4x4 transformation matrix.

Constructors

Method New(a:Double, b:Double, c:Double, d:Double, e:Double, f:Double, g:Double, h:Double, i:Double, j:Double, k:Double, l:Double, m:Double, n:Double, o:Double, p:Double)

Creates a new SMat4 from the supplied arguments.


Operators

Method Operator+:SMat4(z:SMat4 Var)

Adds z to the matrix, returning a new matrix.


Method Operator-:SMat4(z:SMat4 Var)

Subtracts z from the matrix, returning a new matrix.


Method Operator*:SMat4(z:SMat4 Var)

Multiplies the matrix by z, returning a new matrix.


Methods

Method Apply:SVec2(v:SVec2)

Applies the matrix to the vector v, returning a new vector.


Method Apply:SVec3(v:SVec3)

Applies the 4x4 matrix b to the vector, returning a new vector.


Method Adjoint:SMat4()

Returns the transposition of the cofactor matrix.


Method CompMul:SMat4(z:SMat4 Var)

Multiplies the matrix by z by its components, returning a new matrix.


Method Determinant:Double()

Returns the determinant of the matrix.


Method Invert:SMat4()

The inverse of this matrix.

An inverted matrix is such that if multiplied by the original would result in identity matrix. If some matrix transforms vectors in a particular way, then the inverse matrix can transform them back.


Method Rotate:SMat4(axis:SVec3, angle:Double)

Creates a rotation matrix, rotated angle degrees around the point axis.


Method Scale:SMat4(s:SVec3)

Scales the matrix, return the new scaled matrix.


Method Transpose:SMat4()

Returns the transpose of this matrix.

The transposed matrix is the one that has the columns exchanged with its rows.


Method Translate:SMat4(s:SVec3)

Translates the matrix to s.


Method ToString:String() Override

Returns a String representation of the matrix.


Functions

Function Identity:SMat4()

Returns the identity matrix.


Function Frustum:SMat4(l:Double, r:Double, b:Double, t:Double, n:Double, f:Double)

Returns a projection matrix with a viewing frustum defined by the plane coordinates passed in.


Function LookAt:SMat4(eye:SVec3, pos:SVec3, up:SVec3)

Computes a transformation matrix that corresponds to a camera viewing the eye from the pos.

The right-hand vector is perpendicular to the up vector.


Function Orthogonal:SMat4(width:Double, height:Double, zNear:Double, zFar:Double)

Creates an orthogonal projection matrix.

The returned matrix, when used as a Camera's projection matrix, creates a view showing the area between width and height, with zNear and zFar as the near and far depth clipping planes.


Function Perspective:SMat4(fov:Double, w:Double, h:Double, n:Double, f:Double)

Creates a perspective projection matrix.


Function Rotation:SMat4(axis:SVec3, angle:Double)

Returns a rotation matrix on the given axis and angle degrees.


Function Scaling:SMat4(s:SVec3)

Creates a scaling matrix.


Function Translation:SMat4(s:SVec3)

Creates a translation matrix.


← SMat3ISMat4F →
  • Constructors
    • Method New(a:Double, b:Double, c:Double, d:Double, e:Double, f:Double, g:Double, h:Double, i:Double, j:Double, k:Double, l:Double, m:Double, n:Double, o:Double, p:Double)
  • Operators
    • Method Operator+:SMat4(z:SMat4 Var)
    • Method Operator-:SMat4(z:SMat4 Var)
    • Method Operator*:SMat4(z:SMat4 Var)
  • Methods
    • Method Apply:SVec2(v:SVec2)
    • Method Apply:SVec3(v:SVec3)
    • Method Adjoint:SMat4()
    • Method CompMul:SMat4(z:SMat4 Var)
    • Method Determinant:Double()
    • Method Invert:SMat4()
    • Method Rotate:SMat4(axis:SVec3, angle:Double)
    • Method Scale:SMat4(s:SVec3)
    • Method Transpose:SMat4()
    • Method Translate:SMat4(s:SVec3)
    • Method ToString:String() Override
  • Functions
    • Function Identity:SMat4()
    • Function Frustum:SMat4(l:Double, r:Double, b:Double, t:Double, n:Double, f:Double)
    • Function LookAt:SMat4(eye:SVec3, pos:SVec3, up:SVec3)
    • Function Orthogonal:SMat4(width:Double, height:Double, zNear:Double, zFar:Double)
    • Function Perspective:SMat4(fov:Double, w:Double, h:Double, n:Double, f:Double)
    • Function Rotation:SMat4(axis:SVec3, angle:Double)
    • Function Scaling:SMat4(s:SVec3)
    • Function Translation:SMat4(s:SVec3)
BlitzMax
Docs
Getting StartedDownloadsAbout
Community
ResourcesSyntaxBomb Forums
More
NewsGitHubStar
Copyright © 2019 Bruce A Henderson