We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I wrote this thinking it would be possible, but it turns out it isn't yet. It would be very nice if this could be done.
impl Mul<Quaternion, Quaternion> for Quaternion { fn mul(&self, rhs: &Quaternion) -> Quaternion { Quaternion::new ( self.w * rhs.x + self.x * self.w + self.y * rhs.z - self.z * rhs.y, self.w * rhs.y + self.y * self.w + self.z * rhs.x - self.x * rhs.z, self.w * rhs.z + self.z * self.w + self.x * rhs.y - self.y * rhs.x, self.w * rhs.w - self.x * self.x - self.y * rhs.y - self.z * rhs.z ) } } impl Mul<math::Vec3f, math::Vec3f> for Quaternion { fn mul(&self, rhs: &math::Vec3f) -> math::Vec3f { let vn = math::Vec3f::new_normalized(rhs); let vecq = Quaternion::new(vn.x, vn.y, vn.z, 0.0); let resq = (vecq * self.get_conjugate()) * self; math::Vec3f::new(resq.x, resq.y, resq.z) } } impl Mul<Component, Quaternion> for Quaternion { fn mul(&self, rhs: &Component) -> Quaternion { Quaternion::new ( self.x * *rhs, self.y * *rhs, self.z * *rhs, self.w * *rhs ) } }
The text was updated successfully, but these errors were encountered:
There is a work-around, described here under "what if I want overloading?", but hopefully the code you write will be legal some day.
Sorry, something went wrong.
Triage: dupe of #7590.
No branches or pull requests
I wrote this thinking it would be possible, but it turns out it isn't yet. It would be very nice if this could be done.
The text was updated successfully, but these errors were encountered: