Browse Source

added multiply by scalar

Dave Schuyler 20 years ago
parent
commit
5ae60423ec
2 changed files with 23 additions and 0 deletions
  1. 20 0
      panda/src/linmath/lrotation_src.I
  2. 3 0
      panda/src/linmath/lrotation_src.h

+ 20 - 0
panda/src/linmath/lrotation_src.I

@@ -92,6 +92,26 @@ FLOATNAME(LRotation)(FLOATTYPE h, FLOATTYPE p, FLOATTYPE r) {
   set_hpr(FLOATNAME(LVecBase3)(h, p, r));
   set_hpr(FLOATNAME(LVecBase3)(h, p, r));
 }
 }
 
 
+////////////////////////////////////////////////////////////////////
+//     Function: LRotation::rotation * scalar
+//       Access: Public
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE_LINMATH FLOATNAME(LRotation) FLOATNAME(LRotation)::
+operator * (FLOATTYPE scalar) const {
+  return FLOATNAME(LVecBase4)::operator * (scalar);
+}
+
+////////////////////////////////////////////////////////////////////
+//     Function: LRotation::rotation / scalar
+//       Access: Public
+//  Description:
+////////////////////////////////////////////////////////////////////
+INLINE_LINMATH FLOATNAME(LRotation) FLOATNAME(LRotation)::
+operator / (FLOATTYPE scalar) const {
+  return FLOATNAME(LVecBase4)::operator / (scalar);
+}
+
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 //     Function: LRotation::operator *
 //     Function: LRotation::operator *
 //       Access: public
 //       Access: public

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

@@ -30,6 +30,9 @@ PUBLISHED:
   INLINE_LINMATH FLOATNAME(LRotation)(const FLOATNAME(LMatrix4) &);
   INLINE_LINMATH FLOATNAME(LRotation)(const FLOATNAME(LMatrix4) &);
   INLINE_LINMATH FLOATNAME(LRotation)(FLOATTYPE, FLOATTYPE, FLOATTYPE);
   INLINE_LINMATH FLOATNAME(LRotation)(FLOATTYPE, FLOATTYPE, FLOATTYPE);
 
 
+  INLINE_LINMATH FLOATNAME(LRotation) operator * (FLOATTYPE scalar) const;
+  INLINE_LINMATH FLOATNAME(LRotation) operator / (FLOATTYPE scalar) const;
+
   INLINE_LINMATH FLOATNAME(LRotation)
   INLINE_LINMATH FLOATNAME(LRotation)
   operator*(const FLOATNAME(LRotation)& other) const;
   operator*(const FLOATNAME(LRotation)& other) const;