40 #ifndef __MO_MATH_VECTOR4_H__ 41 #define __MO_MATH_VECTOR4_H__ 58 m_afTuple[0] = afTuple[0];
59 m_afTuple[1] = afTuple[1];
60 m_afTuple[2] = afTuple[2];
61 m_afTuple[3] = afTuple[3];
71 inline operator const Real* ()
const {
return m_afTuple; }
72 inline operator Real* () {
return m_afTuple; }
73 inline Real operator[] (
int i)
const {
return m_afTuple[i]; }
74 inline Real& operator[] (
int i) {
return m_afTuple[i]; }
75 inline Real
X ()
const {
return m_afTuple[0]; }
76 inline Real&
X () {
return m_afTuple[0]; }
77 inline Real
Y ()
const {
return m_afTuple[1]; }
78 inline Real&
Y () {
return m_afTuple[1]; }
79 inline Real
Z ()
const {
return m_afTuple[2]; }
80 inline Real&
Z () {
return m_afTuple[2]; }
81 inline Real
W ()
const {
return m_afTuple[3]; }
82 inline Real&
W () {
return m_afTuple[3]; }
122 fScalar*m_afTuple[0],
123 fScalar*m_afTuple[1],
124 fScalar*m_afTuple[2],
125 fScalar*m_afTuple[3]);
131 if (fScalar != (Real)0.0)
133 Real fInvScalar = ((Real)1.0)/fScalar;
134 kQuot.
m_afTuple[0] = fInvScalar*m_afTuple[0];
135 kQuot.
m_afTuple[1] = fInvScalar*m_afTuple[1];
136 kQuot.
m_afTuple[2] = fInvScalar*m_afTuple[2];
137 kQuot.
m_afTuple[3] = fInvScalar*m_afTuple[3];
177 m_afTuple[0] *= fScalar;
178 m_afTuple[1] *= fScalar;
179 m_afTuple[2] *= fScalar;
180 m_afTuple[3] *= fScalar;
185 if (fScalar != (Real)0.0)
187 Real fInvScalar = ((Real)1.0)/fScalar;
188 m_afTuple[0] *= fInvScalar;
189 m_afTuple[1] *= fInvScalar;
190 m_afTuple[2] *= fInvScalar;
191 m_afTuple[3] *= fInvScalar;
208 m_afTuple[0]*m_afTuple[0] +
209 m_afTuple[1]*m_afTuple[1] +
210 m_afTuple[2]*m_afTuple[2] +
211 m_afTuple[3]*m_afTuple[3]);
216 m_afTuple[0]*m_afTuple[0] +
217 m_afTuple[1]*m_afTuple[1] +
218 m_afTuple[2]*m_afTuple[2] +
219 m_afTuple[3]*m_afTuple[3];
231 Real fLength = Length();
235 Real fInvLength = ((Real)1.0)/fLength;
236 m_afTuple[0] *= fInvLength;
237 m_afTuple[1] *= fInvLength;
238 m_afTuple[2] *= fInvLength;
239 m_afTuple[3] *= fInvLength;
244 m_afTuple[0] = (Real)0.0;
245 m_afTuple[1] = (Real)0.0;
246 m_afTuple[2] = (Real)0.0;
247 m_afTuple[3] = (Real)0.0;
258 if ((0 < l) && (0 < lv))
return Dot(rkV) / (l * lv);
278 return memcmp(m_afTuple,rkV.
m_afTuple,4*
sizeof(Real));
286 template <
class Real>
289 moVector4<Real> v4(fScalar*rkV[0], fScalar*rkV[1], fScalar*rkV[2], fScalar*rkV[3]);
moVector4< Real > operator*(Real fScalar, const moVector4< Real > &rkV)
bool operator>(const TiXmlString &a, const TiXmlString &b)
moVector4< MOlong > moVector4i
moVector4< MOfloat > moVector4f
bool operator<(const TiXmlString &a, const TiXmlString &b)
static Real ACos(Real fValue)
moVector4(const Real *afTuple)
Real Angle(const moVector4< Real > &rkV)
static const moVector4 ZERO
Clase base abstracta de donde deben derivar los objetos [virtual pura].
static const moVector4 UNIT_Y
static const moVector4 UNIT_X
static const moVector4 ONE
Real Dot(const moVector4 &rkV) const
static Real Sqrt(Real fValue)
Real SquaredLength() const
LIBMOLDEO_API moText0 operator+(const moText0 &txt1, const moText0 &txt2)
int CompareArrays(const moVector4 &rkV) const
bool operator==(const TiXmlString &a, const TiXmlString &b)
moDeclareExportedDynamicArray(moVector4i, moVector4iArray)
static const moVector4 UNIT_W
bool operator>=(const TiXmlString &a, const TiXmlString &b)
bool operator!=(const TiXmlString &a, const TiXmlString &b)
moVector4(const moVector4 &rkV)
static const moVector4 UNIT_Z
moVector4(Real fX, Real fY, Real fZ, Real fW)
moVector4< MOdouble > moVector4d
bool operator<=(const TiXmlString &a, const TiXmlString &b)
Real Cosine(const moVector4< Real > &rkV)