Gilles's patch to get rid of the the same identifier warnings
Kent -- mein@cs.umn.edu
This commit is contained in:
parent
cfceb16f4a
commit
4a9377a861
|
@ -57,7 +57,7 @@ public:
|
|||
MT_Point3() {}
|
||||
MT_Point3(const float *v) : MT_Vector3(v) {}
|
||||
MT_Point3(const double *v) : MT_Vector3(v) {}
|
||||
MT_Point3(MT_Scalar x, MT_Scalar y, MT_Scalar z) : MT_Vector3(x, y, z) {}
|
||||
MT_Point3(MT_Scalar xx, MT_Scalar yy, MT_Scalar zz) : MT_Vector3(xx, yy, zz) {}
|
||||
|
||||
MT_Point3& operator+=(const MT_Vector3& v);
|
||||
MT_Point3& operator-=(const MT_Vector3& v);
|
||||
|
|
|
@ -61,8 +61,8 @@ public:
|
|||
MT_Quaternion(const MT_Vector4& v) : MT_Vector4(v) {}
|
||||
MT_Quaternion(const float v[4]) : MT_Vector4(v) {}
|
||||
MT_Quaternion(const double v[4]) : MT_Vector4(v) {}
|
||||
MT_Quaternion(MT_Scalar x, MT_Scalar y, MT_Scalar z, MT_Scalar w) :
|
||||
MT_Vector4(x, y, z, w) {}
|
||||
MT_Quaternion(MT_Scalar xx, MT_Scalar yy, MT_Scalar zz, MT_Scalar ww) :
|
||||
MT_Vector4(xx, yy, zz, ww) {}
|
||||
MT_Quaternion(const MT_Vector3& axis, MT_Scalar angle) {
|
||||
setRotation(axis, angle);
|
||||
}
|
||||
|
|
|
@ -56,9 +56,9 @@
|
|||
class MT_Tuple2 {
|
||||
public:
|
||||
MT_Tuple2() {}
|
||||
MT_Tuple2(const float *v) { setValue(v); }
|
||||
MT_Tuple2(const double *v) { setValue(v); }
|
||||
MT_Tuple2(MT_Scalar x, MT_Scalar y) { setValue(x, y); }
|
||||
MT_Tuple2(const float *vv) { setValue(vv); }
|
||||
MT_Tuple2(const double *vv) { setValue(vv); }
|
||||
MT_Tuple2(MT_Scalar xx, MT_Scalar yy) { setValue(xx, yy); }
|
||||
|
||||
MT_Scalar& operator[](int i) { return m_co[i]; }
|
||||
const MT_Scalar& operator[](int i) const { return m_co[i]; }
|
||||
|
@ -78,24 +78,24 @@ public:
|
|||
MT_Scalar *getValue() { return m_co; }
|
||||
const MT_Scalar *getValue() const { return m_co; }
|
||||
|
||||
void getValue(float *v) const {
|
||||
v[0] = m_co[0]; v[1] = m_co[1];
|
||||
void getValue(float *vv) const {
|
||||
vv[0] = m_co[0]; vv[1] = m_co[1];
|
||||
}
|
||||
|
||||
void getValue(double *v) const {
|
||||
v[0] = m_co[0]; v[1] = m_co[1];
|
||||
void getValue(double *vv) const {
|
||||
vv[0] = m_co[0]; vv[1] = m_co[1];
|
||||
}
|
||||
|
||||
void setValue(const float *v) {
|
||||
m_co[0] = v[0]; m_co[1] = v[1];
|
||||
void setValue(const float *vv) {
|
||||
m_co[0] = vv[0]; m_co[1] = vv[1];
|
||||
}
|
||||
|
||||
void setValue(const double *v) {
|
||||
m_co[0] = v[0]; m_co[1] = v[1];
|
||||
void setValue(const double *vv) {
|
||||
m_co[0] = vv[0]; m_co[1] = vv[1];
|
||||
}
|
||||
|
||||
void setValue(MT_Scalar x, MT_Scalar y) {
|
||||
m_co[0] = x; m_co[1] = y;
|
||||
void setValue(MT_Scalar xx, MT_Scalar yy) {
|
||||
m_co[0] = xx; m_co[1] = yy;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
|
@ -58,7 +58,7 @@ public:
|
|||
MT_Tuple3() {}
|
||||
MT_Tuple3(const float *v) { setValue(v); }
|
||||
MT_Tuple3(const double *v) { setValue(v); }
|
||||
MT_Tuple3(MT_Scalar x, MT_Scalar y, MT_Scalar z) { setValue(x, y, z); }
|
||||
MT_Tuple3(MT_Scalar xx, MT_Scalar yy, MT_Scalar zz) { setValue(xx, yy, zz); }
|
||||
|
||||
MT_Scalar& operator[](int i) { return m_co[i]; }
|
||||
const MT_Scalar& operator[](int i) const { return m_co[i]; }
|
||||
|
@ -99,8 +99,8 @@ public:
|
|||
m_co[2] = MT_Scalar(v[2]);
|
||||
}
|
||||
|
||||
void setValue(MT_Scalar x, MT_Scalar y, MT_Scalar z) {
|
||||
m_co[0] = x; m_co[1] = y; m_co[2] = z;
|
||||
void setValue(MT_Scalar xx, MT_Scalar yy, MT_Scalar zz) {
|
||||
m_co[0] = xx; m_co[1] = yy; m_co[2] = zz;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
|
@ -58,8 +58,8 @@ public:
|
|||
MT_Tuple4() {}
|
||||
MT_Tuple4(const float *v) { setValue(v); }
|
||||
MT_Tuple4(const double *v) { setValue(v); }
|
||||
MT_Tuple4(MT_Scalar x, MT_Scalar y, MT_Scalar z, MT_Scalar w) {
|
||||
setValue(x, y, z, w);
|
||||
MT_Tuple4(MT_Scalar xx, MT_Scalar yy, MT_Scalar zz, MT_Scalar ww) {
|
||||
setValue(xx, yy, zz, ww);
|
||||
}
|
||||
|
||||
MT_Scalar& operator[](int i) { return m_co[i]; }
|
||||
|
@ -109,8 +109,8 @@ public:
|
|||
m_co[3] = MT_Scalar(v[3]);
|
||||
}
|
||||
|
||||
void setValue(MT_Scalar x, MT_Scalar y, MT_Scalar z, MT_Scalar w) {
|
||||
m_co[0] = x; m_co[1] = y; m_co[2] = z; m_co[3] = w;
|
||||
void setValue(MT_Scalar xx, MT_Scalar yy, MT_Scalar zz, MT_Scalar ww) {
|
||||
m_co[0] = xx; m_co[1] = yy; m_co[2] = zz; m_co[3] = ww;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
|
@ -58,7 +58,7 @@ public:
|
|||
MT_Vector2() {}
|
||||
MT_Vector2(const float *v) : MT_Tuple2(v) {}
|
||||
MT_Vector2(const double *v) : MT_Tuple2(v) {}
|
||||
MT_Vector2(MT_Scalar x, MT_Scalar y) : MT_Tuple2(x, y) {}
|
||||
MT_Vector2(MT_Scalar xx, MT_Scalar yy) : MT_Tuple2(xx, yy) {}
|
||||
|
||||
MT_Vector2& operator+=(const MT_Vector2& v);
|
||||
MT_Vector2& operator-=(const MT_Vector2& v);
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#include "MT_Optimize.h"
|
||||
|
||||
GEN_INLINE MT_Vector2& MT_Vector2::operator+=(const MT_Vector2& v) {
|
||||
m_co[0] += v[0]; m_co[1] += v[1];
|
||||
GEN_INLINE MT_Vector2& MT_Vector2::operator+=(const MT_Vector2& vv) {
|
||||
m_co[0] += vv[0]; m_co[1] += vv[1];
|
||||
return *this;
|
||||
}
|
||||
|
||||
GEN_INLINE MT_Vector2& MT_Vector2::operator-=(const MT_Vector2& v) {
|
||||
m_co[0] -= v[0]; m_co[1] -= v[1];
|
||||
GEN_INLINE MT_Vector2& MT_Vector2::operator-=(const MT_Vector2& vv) {
|
||||
m_co[0] -= vv[0]; m_co[1] -= vv[1];
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -43,8 +43,8 @@ GEN_INLINE MT_Vector2 operator/(const MT_Vector2& v, MT_Scalar s) {
|
|||
return v * (1.0 / s);
|
||||
}
|
||||
|
||||
GEN_INLINE MT_Scalar MT_Vector2::dot(const MT_Vector2& v) const {
|
||||
return m_co[0] * v[0] + m_co[1] * v[1];
|
||||
GEN_INLINE MT_Scalar MT_Vector2::dot(const MT_Vector2& vv) const {
|
||||
return m_co[0] * vv[0] + m_co[1] * vv[1];
|
||||
}
|
||||
|
||||
GEN_INLINE MT_Scalar MT_Vector2::length2() const { return dot(*this); }
|
||||
|
@ -59,18 +59,18 @@ GEN_INLINE bool MT_Vector2::fuzzyZero() const { return MT_fuzzyZero2(length2());
|
|||
GEN_INLINE void MT_Vector2::normalize() { *this /= length(); }
|
||||
GEN_INLINE MT_Vector2 MT_Vector2::normalized() const { return *this / length(); }
|
||||
|
||||
GEN_INLINE void MT_Vector2::scale(MT_Scalar x, MT_Scalar y) {
|
||||
m_co[0] *= x; m_co[1] *= y;
|
||||
GEN_INLINE void MT_Vector2::scale(MT_Scalar xx, MT_Scalar yy) {
|
||||
m_co[0] *= xx; m_co[1] *= yy;
|
||||
}
|
||||
|
||||
GEN_INLINE MT_Vector2 MT_Vector2::scaled(MT_Scalar x, MT_Scalar y) const {
|
||||
return MT_Vector2(m_co[0] * x, m_co[1] * y);
|
||||
GEN_INLINE MT_Vector2 MT_Vector2::scaled(MT_Scalar xx, MT_Scalar yy) const {
|
||||
return MT_Vector2(m_co[0] * xx, m_co[1] * yy);
|
||||
}
|
||||
|
||||
GEN_INLINE MT_Scalar MT_Vector2::angle(const MT_Vector2& v) const {
|
||||
MT_Scalar s = sqrt(length2() * v.length2());
|
||||
GEN_INLINE MT_Scalar MT_Vector2::angle(const MT_Vector2& vv) const {
|
||||
MT_Scalar s = sqrt(length2() * vv.length2());
|
||||
MT_assert(!MT_fuzzyZero(s));
|
||||
return acos(dot(v) / s);
|
||||
return acos(dot(vv) / s);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ public:
|
|||
MT_Vector3() {}
|
||||
MT_Vector3(const float *v) : MT_Tuple3(v) {}
|
||||
MT_Vector3(const double *v) : MT_Tuple3(v) {}
|
||||
MT_Vector3(MT_Scalar x, MT_Scalar y, MT_Scalar z) : MT_Tuple3(x, y, z) {}
|
||||
MT_Vector3(MT_Scalar xx, MT_Scalar yy, MT_Scalar zz) : MT_Tuple3(xx, yy, zz) {}
|
||||
|
||||
MT_Vector3& operator+=(const MT_Vector3& v);
|
||||
MT_Vector3& operator-=(const MT_Vector3& v);
|
||||
|
|
|
@ -77,12 +77,12 @@ GEN_INLINE MT_Vector3 MT_Vector3::safe_normalized() const {
|
|||
*this / len;
|
||||
}
|
||||
|
||||
GEN_INLINE void MT_Vector3::scale(MT_Scalar x, MT_Scalar y, MT_Scalar z) {
|
||||
m_co[0] *= x; m_co[1] *= y; m_co[2] *= z;
|
||||
GEN_INLINE void MT_Vector3::scale(MT_Scalar xx, MT_Scalar yy, MT_Scalar zz) {
|
||||
m_co[0] *= xx; m_co[1] *= yy; m_co[2] *= zz;
|
||||
}
|
||||
|
||||
GEN_INLINE MT_Vector3 MT_Vector3::scaled(MT_Scalar x, MT_Scalar y, MT_Scalar z) const {
|
||||
return MT_Vector3(m_co[0] * x, m_co[1] * y, m_co[2] * z);
|
||||
GEN_INLINE MT_Vector3 MT_Vector3::scaled(MT_Scalar xx, MT_Scalar yy, MT_Scalar zz) const {
|
||||
return MT_Vector3(m_co[0] * xx, m_co[1] * yy, m_co[2] * zz);
|
||||
}
|
||||
|
||||
GEN_INLINE MT_Scalar MT_Vector3::angle(const MT_Vector3& v) const {
|
||||
|
|
|
@ -59,8 +59,8 @@ public:
|
|||
MT_Vector4() {}
|
||||
MT_Vector4(const float *v) : MT_Tuple4(v) {}
|
||||
MT_Vector4(const double *v) : MT_Tuple4(v) {}
|
||||
MT_Vector4(MT_Scalar x, MT_Scalar y, MT_Scalar z, MT_Scalar w) :
|
||||
MT_Tuple4(x, y, z, w) {}
|
||||
MT_Vector4(MT_Scalar xx, MT_Scalar yy, MT_Scalar zz, MT_Scalar ww) :
|
||||
MT_Tuple4(xx, yy, zz, ww) {}
|
||||
|
||||
MT_Vector4& operator+=(const MT_Vector4& v);
|
||||
MT_Vector4& operator-=(const MT_Vector4& v);
|
||||
|
|
|
@ -54,12 +54,12 @@ GEN_INLINE MT_Vector4 MT_Vector4::absolute() const {
|
|||
return MT_Vector4(MT_abs(m_co[0]), MT_abs(m_co[1]), MT_abs(m_co[2]), MT_abs(m_co[3]));
|
||||
}
|
||||
|
||||
GEN_INLINE void MT_Vector4::scale(MT_Scalar x, MT_Scalar y, MT_Scalar z, MT_Scalar w) {
|
||||
m_co[0] *= x; m_co[1] *= y; m_co[2] *= z; m_co[3] *= w;
|
||||
GEN_INLINE void MT_Vector4::scale(MT_Scalar xx, MT_Scalar yy, MT_Scalar zz, MT_Scalar ww) {
|
||||
m_co[0] *= xx; m_co[1] *= yy; m_co[2] *= zz; m_co[3] *= ww;
|
||||
}
|
||||
|
||||
GEN_INLINE MT_Vector4 MT_Vector4::scaled(MT_Scalar x, MT_Scalar y, MT_Scalar z, MT_Scalar w) const {
|
||||
return MT_Vector4(m_co[0] * x, m_co[1] * y, m_co[2] * z, m_co[3] * w);
|
||||
GEN_INLINE MT_Vector4 MT_Vector4::scaled(MT_Scalar xx, MT_Scalar yy, MT_Scalar zz, MT_Scalar ww) const {
|
||||
return MT_Vector4(m_co[0] * xx, m_co[1] * yy, m_co[2] * zz, m_co[3] * ww);
|
||||
}
|
||||
|
||||
GEN_INLINE bool MT_Vector4::fuzzyZero() const { return MT_fuzzyZero2(length2()); }
|
||||
|
|
Loading…
Reference in New Issue