Curious about com.jme3.math.Quaternion.multLocal(Vector3f v)

Just curious: multLocal(Vector3f v) in Quaternion performs changes to the parameter supplied, not self. Why is this different from all the other implementations of multLocal - which seems to return ‘this’?

This is a Bug then, the local Variant should always well modify itself.
Curious if it breaks usercode though

No, it’s not a bug.
Multiplying a Quaternion and a vector gives a vector so it won’t modify the quaternion instance.
This methods multiplies the quaternion and the vector and returns the result in the given vector. My guess is that it’s been named as opposed to mult(Vector3f) that returns a new vector3f instance. It’s pretty clear in the javadoc.
But yeah I guess it’s a bit confusing compared to the multLocal convention anywhere else in the engine.

I think it should be like this: http://javadoc.jmonkeyengine.org/com/jme3/math/Matrix4f.html#multAcross-com.jme3.math.Vector3f-com.jme3.math.Vector3f-

I guess it’s derived from the fact that you write: vec = quat * vec
So the programmer followed the mathematical order written on a sheet of paper.
That’s a little bit confusing, but … oh … well … as nehon said. ^^

EDIT: more like this here: http://javadoc.jmonkeyengine.org/com/jme3/math/Matrix3f.html#multLocal-com.jme3.math.Vector3f-

EDIT: in fact, it’s not that confusing. :slight_smile: