mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 16:21:33 +11:00
implement multiplication by scalar
This commit is contained in:
parent
9ed5ee2295
commit
96401c2833
|
@ -193,6 +193,26 @@ impl Mul for AffineMatrix {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Mul<Num<i32, 8>> for AffineMatrix {
|
||||||
|
type Output = Self;
|
||||||
|
fn mul(self, rhs: Num<i32, 8>) -> Self::Output {
|
||||||
|
self * AffineMatrix {
|
||||||
|
a: rhs,
|
||||||
|
b: 0.into(),
|
||||||
|
c: 0.into(),
|
||||||
|
d: rhs,
|
||||||
|
x: 0.into(),
|
||||||
|
y: 0.into(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl MulAssign<Num<i32, 8>> for AffineMatrix {
|
||||||
|
fn mul_assign(&mut self, rhs: Num<i32, 8>) {
|
||||||
|
*self = *self * rhs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl MulAssign for AffineMatrix {
|
impl MulAssign for AffineMatrix {
|
||||||
fn mul_assign(&mut self, rhs: Self) {
|
fn mul_assign(&mut self, rhs: Self) {
|
||||||
*self = *self * rhs;
|
*self = *self * rhs;
|
||||||
|
|
Loading…
Reference in a new issue