Possible issue with BEPU Quaternions (minor)

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
mcmonkey
Posts: 92
Joined: Fri Apr 17, 2015 11:42 pm

Possible issue with BEPU Quaternions (minor)

Post 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...
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Possible issue with BEPU Quaternions (minor)

Post 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)
Post Reply