Struct cgmath::Matrix2
[−]
[src]
pub struct Matrix2<S> { pub x: Vector2<S>, pub y: Vector2<S>, }
A 2 x 2, column major matrix
Fields
x | |
y |
Methods
impl<S> Matrix2<S>
fn new(c0r0: S, c0r1: S, c1r0: S, c1r1: S) -> Matrix2<S>
Create a new matrix, providing values for each index.
fn from_cols(c0: Vector2<S>, c1: Vector2<S>) -> Matrix2<S>
Create a new matrix, providing columns.
impl<S: BaseNum> Matrix2<S>
fn from_value(value: S) -> Matrix2<S>
Create a new diagonal matrix, providing a single value to use for each non-zero index.
fn zero() -> Matrix2<S>
Create a zero matrix (all zeros).
fn identity() -> Matrix2<S>
Create an identity matrix (diagonal matrix of ones).
impl<S: BaseFloat> Matrix2<S>
fn look_at(dir: &Vector2<S>, up: &Vector2<S>) -> Matrix2<S>
Create a transformation matrix that will cause a vector to point at
dir
, using up
for orientation.
fn from_angle(theta: Rad<S>) -> Matrix2<S>
impl<S: Copy + Neg<Output=S>> Matrix2<S>
fn neg_self(&mut self)
Negate this Matrix2
in-place.