struct Eagle::Mat3

Overview

A 3x3 matrix in column-major order. Eagle uses it for normal matrices in 3D shaders.

Defined in:

eagle/math/mat4.cr

Constructors

Instance Method Summary

Constructor Detail

def self.identity : Mat3 #

The identity matrix.


def self.new(m : StaticArray(Float32, 9)) #

Wraps 9 floats in column-major order.


def self.new #

Creates the zero matrix.


Instance Method Detail

def *(o : Mat3) : Mat3 #

Composes matrices.


def *(v : Vec3) : Vec3 #

Transforms a vector.


def [](col : Int, row : Int) : Float32 #

Reads the element at col, row.


def []=(col : Int, row : Int, v : Number) #

Writes the element at col, row.


def data : StaticArray(Float32, 9) #

The raw column-major storage.


def determinant : Float32 #

The determinant.


def inverse : Mat3 #

The inverse matrix.


def to_unsafe : Pointer(Float32) #

Pointer to the 9 floats, for passing to OpenGL.


def transposed : Mat3 #

Rows and columns swapped.