Allow writing matrix * scalar
This commit is contained in:
parent
7916a14f70
commit
d560242ed4
1 changed files with 21 additions and 0 deletions
|
@ -510,6 +510,13 @@ impl<S: BaseFloat> Mul for Matrix2<S> {
|
|||
fn mul(self, other: Matrix2<S>) -> Matrix2<S> { self.mul_m(&other) }
|
||||
}
|
||||
|
||||
impl<S: BaseFloat> Mul<S> for Matrix2<S> {
|
||||
type Output = Matrix2<S>;
|
||||
|
||||
#[inline]
|
||||
fn mul(self, other: S) -> Matrix2<S> { self.mul_s(other) }
|
||||
}
|
||||
|
||||
impl<S: BaseFloat> Mul for Matrix3<S> {
|
||||
type Output = Matrix3<S>;
|
||||
|
||||
|
@ -517,6 +524,13 @@ impl<S: BaseFloat> Mul for Matrix3<S> {
|
|||
fn mul(self, other: Matrix3<S>) -> Matrix3<S> { self.mul_m(&other) }
|
||||
}
|
||||
|
||||
impl<S: BaseFloat> Mul<S> for Matrix3<S> {
|
||||
type Output = Matrix3<S>;
|
||||
|
||||
#[inline]
|
||||
fn mul(self, other: S) -> Matrix3<S> { self.mul_s(other) }
|
||||
}
|
||||
|
||||
impl<S: BaseFloat> Mul for Matrix4<S> {
|
||||
type Output = Matrix4<S>;
|
||||
|
||||
|
@ -524,6 +538,13 @@ impl<S: BaseFloat> Mul for Matrix4<S> {
|
|||
fn mul(self, other: Matrix4<S>) -> Matrix4<S> { self.mul_m(&other) }
|
||||
}
|
||||
|
||||
impl<S: BaseFloat> Mul<S> for Matrix4<S> {
|
||||
type Output = Matrix4<S>;
|
||||
|
||||
#[inline]
|
||||
fn mul(self, other: S) -> Matrix4<S> { self.mul_s(other) }
|
||||
}
|
||||
|
||||
impl<S: BaseFloat> One for Matrix2<S> {
|
||||
#[inline]
|
||||
fn one() -> Matrix2<S> { Matrix2::identity() }
|
||||
|
|
Loading…
Reference in a new issue