Sfoglia il codice sorgente

properly cast new operator * return values

David Rose 20 anni fa
parent
commit
b8b1e3d87e
2 ha cambiato i file con 8 aggiunte e 8 eliminazioni
  1. 5 5
      panda/src/linmath/lrotation_src.I
  2. 3 3
      panda/src/linmath/lrotation_src.h

+ 5 - 5
panda/src/linmath/lrotation_src.I

@@ -31,7 +31,7 @@ FLOATNAME(LRotation)() {
 //  Description:
 ////////////////////////////////////////////////////////////////////
 INLINE_LINMATH FLOATNAME(LRotation)::
-FLOATNAME(LRotation)(const FLOATNAME(LQuaternion)& c) :
+FLOATNAME(LRotation)(const FLOATNAME(LQuaternion) &c) :
   FLOATNAME(LQuaternion)(c) {
 }
 
@@ -99,7 +99,7 @@ FLOATNAME(LRotation)(FLOATTYPE h, FLOATTYPE p, FLOATTYPE r) {
 ////////////////////////////////////////////////////////////////////
 INLINE_LINMATH FLOATNAME(LRotation) FLOATNAME(LRotation)::
 operator * (FLOATTYPE scalar) const {
-  return FLOATNAME(LVecBase4)::operator * (scalar);
+  return FLOATNAME(LRotation)(FLOATNAME(LVecBase4)::operator * (scalar));
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -109,7 +109,7 @@ operator * (FLOATTYPE scalar) const {
 ////////////////////////////////////////////////////////////////////
 INLINE_LINMATH FLOATNAME(LRotation) FLOATNAME(LRotation)::
 operator / (FLOATTYPE scalar) const {
-  return FLOATNAME(LVecBase4)::operator / (scalar);
+  return FLOATNAME(LRotation)(FLOATNAME(LVecBase4)::operator / (scalar));
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -118,7 +118,7 @@ operator / (FLOATTYPE scalar) const {
 //  Description: Rotation * Rotation = Rotation
 ////////////////////////////////////////////////////////////////////
 INLINE_LINMATH FLOATNAME(LRotation) FLOATNAME(LRotation)::
-operator*(const FLOATNAME(LRotation)& other) const {
+operator * (const FLOATNAME(LRotation) &other) const {
   return multiply(other);
 }
 
@@ -130,7 +130,7 @@ operator*(const FLOATNAME(LRotation)& other) const {
 //               to apply an orientation to a rotation.
 ////////////////////////////////////////////////////////////////////
 INLINE_LINMATH FLOATNAME(LQuaternion) FLOATNAME(LRotation)::
-operator*(const FLOATNAME(LQuaternion)& other) const {
+operator * (const FLOATNAME(LQuaternion) &other) const {
   nassert_raise("LRotation * LQuaternion is undefined; use LRotation * LRotation or LQuaternion * LQuaternion");
   return multiply(other);
 }

+ 3 - 3
panda/src/linmath/lrotation_src.h

@@ -23,7 +23,7 @@
 class EXPCL_PANDA FLOATNAME(LRotation) : public FLOATNAME(LQuaternion) {
 PUBLISHED:
   INLINE_LINMATH FLOATNAME(LRotation)();
-  INLINE_LINMATH FLOATNAME(LRotation)(const FLOATNAME(LQuaternion)&);
+  INLINE_LINMATH FLOATNAME(LRotation)(const FLOATNAME(LQuaternion) &);
   INLINE_LINMATH FLOATNAME(LRotation)(FLOATTYPE, FLOATTYPE, FLOATTYPE, FLOATTYPE);
   INLINE_LINMATH FLOATNAME(LRotation)(const FLOATNAME(LVector3) &, FLOATTYPE);
   INLINE_LINMATH FLOATNAME(LRotation)(const FLOATNAME(LMatrix3) &);
@@ -34,10 +34,10 @@ PUBLISHED:
   INLINE_LINMATH FLOATNAME(LRotation) operator / (FLOATTYPE scalar) const;
 
   INLINE_LINMATH FLOATNAME(LRotation)
-  operator*(const FLOATNAME(LRotation)& other) const;
+  operator * (const FLOATNAME(LRotation) &other) const;
 
   INLINE_LINMATH FLOATNAME(LQuaternion)
-  operator*(const FLOATNAME(LQuaternion)& other) const;
+  operator * (const FLOATNAME(LQuaternion) &other) const;
 
 public:
   static TypeHandle get_class_type() {