2
0
Эх сурвалжийг харах

fixed get_rotation() to return a Mat3 instead of a vec3

Josh Wilson 19 жил өмнө
parent
commit
79cdf6dc36

+ 5 - 3
panda/src/ode/odeBody.I

@@ -140,10 +140,12 @@ get_position() const {
   return LVecBase3f(res[0], res[1], res[2]);
 }
 
-INLINE LVecBase3f OdeBody::
+INLINE LMatrix3f OdeBody::
 get_rotation() const {
-  const dReal *res = dBodyGetRotation(_id);
-  return LVecBase3f(res[0], res[1], res[2]);
+  const dReal *rot = dBodyGetRotation(_id);
+  return LMatrix3f(rot[0], rot[1], rot[2],
+                   rot[4], rot[5], rot[6],
+                   rot[8], rot[9], rot[10]);
 }
 
 INLINE LVecBase4f OdeBody::

+ 1 - 1
panda/src/ode/odeBody.h

@@ -72,7 +72,7 @@ PUBLISHED:
   INLINE void* get_data() const;
 
   INLINE LVecBase3f  get_position() const;
-  INLINE LVecBase3f  get_rotation() const;
+  INLINE LMatrix3f  get_rotation() const;
   INLINE LVecBase4f  get_quaternion() const;
   INLINE LVecBase3f  get_linear_vel() const;
   INLINE LVecBase3f  get_angular_vel() const;