raise assertions for undefined operations
This commit is contained in:
parent
1ee1c38f8e
commit
4a66fa2a1b
|
|
@ -89,7 +89,7 @@ FLOATNAME(LOrientation)(const FLOATNAME(LMatrix4) &m) {
|
|||
// Applies an rotation to an orientation.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE_LINMATH FLOATNAME(LOrientation) FLOATNAME(LOrientation)::
|
||||
operator *(const FLOATNAME(LQuaternion)& other) const {
|
||||
operator *(const FLOATNAME(LRotation)& other) const {
|
||||
return multiply(other);
|
||||
}
|
||||
|
||||
|
|
@ -101,6 +101,7 @@ operator *(const FLOATNAME(LQuaternion)& other) const {
|
|||
// simply return the rhs.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE_LINMATH FLOATNAME(LOrientation) FLOATNAME(LOrientation)::
|
||||
operator *(const FLOATNAME(LOrientation)& other) const {
|
||||
return other;
|
||||
operator *(const FLOATNAME(LQuaternion)& other) const {
|
||||
nassert_raise("LOrientation * LQuaternion is undefined; use LOrientation * LRotation or LQuaternion * LQuaternion");
|
||||
return multiply(other);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,10 +30,10 @@ PUBLISHED:
|
|||
INLINE_LINMATH FLOATNAME(LOrientation)(const FLOATNAME(LMatrix4) &);
|
||||
|
||||
INLINE_LINMATH FLOATNAME(LOrientation)
|
||||
operator *(const FLOATNAME(LQuaternion)& other) const;
|
||||
operator *(const FLOATNAME(LRotation)& other) const;
|
||||
|
||||
INLINE_LINMATH FLOATNAME(LOrientation)
|
||||
operator *(const FLOATNAME(LOrientation)& other) const;
|
||||
operator *(const FLOATNAME(LQuaternion)& other) const;
|
||||
|
||||
public:
|
||||
static TypeHandle get_class_type() {
|
||||
|
|
|
|||
|
|
@ -107,12 +107,12 @@ operator*(const FLOATNAME(LRotation)& other) const {
|
|||
// Access: public
|
||||
// Description: Rotation * Orientation = Orientation
|
||||
// This is another meaningless operation, attempting
|
||||
// to apply an orientation to a rotation. It simply
|
||||
// returns the rhs.
|
||||
// to apply an orientation to a rotation.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE_LINMATH FLOATNAME(LQuaternion) FLOATNAME(LRotation)::
|
||||
operator*(const FLOATNAME(LQuaternion)& other) const {
|
||||
return other;
|
||||
nassert_raise("LRotation * LQuaternion is undefined; use LRotation * LRotation or LQuaternion * LQuaternion");
|
||||
return multiply(other);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue