m81: update core/point3.rs
use crate::prelude::*;
use crate::scalar;
use skia_bindings::SkPoint3;
-use std::ops::{Add, AddAssign, Neg, Sub, SubAssign};
+use std::ops::{Add, AddAssign, Mul, Neg, Sub, SubAssign};
pub type Vector3 = Point3;
pub type Color3f = Point3;
@@ -60,6 +60,14 @@ impl SubAssign for Point3 {
}
}
+impl Mul<(scalar, Point3)> for Point3 {
+ type Output = Self;
+
+ fn mul(self, (t, p): (scalar, Point3)) -> Self::Output {
+ Self::new(t * p.x, t * p.y, t * p.z)
+ }
+}
+
impl Point3 {
pub const fn new(x: scalar, y: scalar, z: scalar) -> Self {
Self { x, y, z }
