#[repr(C, align(16))]pub struct SsMatrix4x4 {
pub m: [f32; 16],
}Fields§
§m: [f32; 16]Implementations§
Source§impl SsMatrix4x4
impl SsMatrix4x4
pub const IDENTITY: Self
pub const fn identity() -> Self
pub const fn from_array(m: [f32; 16]) -> Self
pub fn create_scale(x: f32, y: f32, z: f32) -> Self
pub fn create_translation(x: f32, y: f32, z: f32) -> Self
pub fn create_rotation_x(radians: f32) -> Self
pub fn create_rotation_y(radians: f32) -> Self
pub fn create_rotation_z(radians: f32) -> Self
pub fn load_columns(&self) -> (f32x4, f32x4, f32x4, f32x4)
pub fn from_columns(c0: f32x4, c1: f32x4, c2: f32x4, c3: f32x4) -> Self
Sourcepub fn compute_world_matrix(
state: &PartState,
parent_world_matrix: Option<&Self>,
parent_size: Option<(f32, f32)>,
) -> (Self, Self)
pub fn compute_world_matrix( state: &PartState, parent_world_matrix: Option<&Self>, parent_size: Option<(f32, f32)>, ) -> (Self, Self)
Calculates the world matrix the part’s children inherit, and the one it draws
with, which adds its local scale. Returns (inheritance_matrix, drawing_matrix).
pub fn multiply(&self, rhs: &Self) -> Self
pub fn transform(&self, v: &SsVector3) -> SsVector3
Sourcepub fn transform_v4_2d(&self, vx: f32x4, vy: f32x4) -> (f32x4, f32x4)
pub fn transform_v4_2d(&self, vx: f32x4, vy: f32x4) -> (f32x4, f32x4)
Transforms four 2D vectors at once using SIMD, ignoring Z and W for performance.
vx, vy are f32x4 containing the x and y components of the four vectors.
Assumes a 2D affine transformation where z=0 and w=1.
pub fn inverse(&self) -> Self
Trait Implementations§
Source§impl Clone for SsMatrix4x4
impl Clone for SsMatrix4x4
impl Copy for SsMatrix4x4
Source§impl Debug for SsMatrix4x4
impl Debug for SsMatrix4x4
Source§impl Default for SsMatrix4x4
impl Default for SsMatrix4x4
Source§impl Index<usize> for SsMatrix4x4
impl Index<usize> for SsMatrix4x4
Source§impl IndexMut<usize> for SsMatrix4x4
impl IndexMut<usize> for SsMatrix4x4
Source§impl Mul for SsMatrix4x4
impl Mul for SsMatrix4x4
Source§impl Mul<&SsMatrix4x4> for &SsMatrix4x4
impl Mul<&SsMatrix4x4> for &SsMatrix4x4
Source§type Output = SsMatrix4x4
type Output = SsMatrix4x4
The resulting type after applying the
* operator.Source§fn mul(self, rhs: &SsMatrix4x4) -> SsMatrix4x4
fn mul(self, rhs: &SsMatrix4x4) -> SsMatrix4x4
Performs the
* operation. Read moreSource§impl Mul<&SsVector3> for &SsMatrix4x4
impl Mul<&SsVector3> for &SsMatrix4x4
Source§impl Mul<SsVector3> for SsMatrix4x4
impl Mul<SsVector3> for SsMatrix4x4
Source§impl MulAssign for SsMatrix4x4
impl MulAssign for SsMatrix4x4
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
Performs the
*= operation. Read moreSource§impl PartialEq for SsMatrix4x4
impl PartialEq for SsMatrix4x4
impl StructuralPartialEq for SsMatrix4x4
Auto Trait Implementations§
impl Freeze for SsMatrix4x4
impl RefUnwindSafe for SsMatrix4x4
impl Send for SsMatrix4x4
impl Sync for SsMatrix4x4
impl Unpin for SsMatrix4x4
impl UnsafeUnpin for SsMatrix4x4
impl UnwindSafe for SsMatrix4x4
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more