[go: up one dir, main page]

macaw 0.30.0

An opinionated game math library built on top the excellent glam
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use glam::Mat3;
use glam::Vec3;

pub trait Mat3Ext {
    /// Multiply `self` by a scaling vector `scale` faster than creating a whole diagonal scaling
    /// matrix and then multiplying that. This operation is commutative.
    fn mul_diagonal_scale(self, scale: Vec3) -> Self;
}

impl Mat3Ext for Mat3 {
    #[inline]
    fn mul_diagonal_scale(mut self, scale: Vec3) -> Self {
        self.x_axis *= scale.x;
        self.y_axis *= scale.y;
        self.z_axis *= scale.z;
        self
    }
}