Page 1 of 1

Possible issue with BEPU Quaternions (minor)

Posted: Thu Sep 28, 2017 5:37 am
by mcmonkey
So this code: https://github.com/bepu/bepuphysics1/bl ... #L461-L468

Code: Select all


        /// <summary>
        /// Negates the components of a quaternion.
        /// </summary>
        /// <param name="q">Quaternion to negate.</param>
        /// <returns>Negated result.</returns>
        public static Quaternion operator -(Quaternion q)
        {
            Quaternion toReturn;
            toReturn.X = q.X;
            toReturn.Y = q.Y;
            toReturn.Z = q.Z;
            toReturn.W = q.W;
            return toReturn;
}
... You can see what I'm thinking, right?
... That doesn't seem to do any amount of negating. It literally just returns the input object duplicated...

Re: Possible issue with BEPU Quaternions (minor)

Posted: Thu Sep 28, 2017 7:45 pm
by Norbo
well you see the negation of a quaternion representing an orientation is an identity transform so uh its consistent to return the same thing and also it totally makes sense that one of the other overloads actually negates the components and

(fixed)