Struct cgmath::Matrix3
[−]
[src]
pub struct Matrix3<S> { pub x: Vector3<S>, pub y: Vector3<S>, pub z: Vector3<S>, }
A 3 x 3, column major matrix
Fields
x | |
y | |
z |
Methods
impl<S> Matrix3<S>
fn new(c0r0: S, c0r1: S, c0r2: S, c1r0: S, c1r1: S, c1r2: S, c2r0: S, c2r1: S, c2r2: S) -> Matrix3<S>
Create a new matrix, providing values for each index.
fn from_cols(c0: Vector3<S>, c1: Vector3<S>, c2: Vector3<S>) -> Matrix3<S>
Create a new matrix, providing columns.
impl<S: BaseNum> Matrix3<S>
fn from_value(value: S) -> Matrix3<S>
Create a new diagonal matrix, providing a single value to use for each non-zero index.
fn zero() -> Matrix3<S>
Create a zero matrix (all zeros).
fn identity() -> Matrix3<S>
Create an identity matrix (diagonal matrix of ones).
impl<S: BaseFloat> Matrix3<S>
fn look_at(dir: &Vector3<S>, up: &Vector3<S>) -> Matrix3<S>
Create a transformation matrix that will cause a vector to point at
dir
, using up
for orientation.
fn from_angle_x(theta: Rad<S>) -> Matrix3<S>
Create a matrix from a rotation around the x
axis (pitch).
fn from_angle_y(theta: Rad<S>) -> Matrix3<S>
Create a matrix from a rotation around the y
axis (yaw).
fn from_angle_z(theta: Rad<S>) -> Matrix3<S>
Create a matrix from a rotation around the z
axis (roll).
fn from_euler(x: Rad<S>, y: Rad<S>, z: Rad<S>) -> Matrix3<S>
Create a matrix from a set of euler angles.
Parameters
x
: the angular rotation around thex
axis (pitch).y
: the angular rotation around they
axis (yaw).z
: the angular rotation around thez
axis (roll).
fn from_axis_angle(axis: &Vector3<S>, angle: Rad<S>) -> Matrix3<S>
Create a matrix from a rotation around an arbitrary axis
fn from_diagonal(value: &Vector3<S>) -> Matrix3<S>
Create a matrix from a non-uniform scale
impl<S: Copy + Neg<Output=S>> Matrix3<S>
fn neg_self(&mut self)
Negate this Matrix3
in-place.