Possible issue with BEPU Quaternions (minor)

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

Possible issue with BEPU Quaternions (minor)

Post by mcmonkey » Thu Sep 28, 2017 5:37 am

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...

Site Admin
Posts: 4680
Joined: Tue Jul 04, 2006 4:45 am

Re: Possible issue with BEPU Quaternions (minor)

Post by Norbo » Thu Sep 28, 2017 7:45 pm

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


Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest