62 : x( fX ), y( fY ), z( fZ )
67 : x( afCoordinate[0] ),
73 inline explicit Vector3(
const int afCoordinate[3] )
75 x = (
Real)afCoordinate[0];
76 y = (
Real)afCoordinate[1];
77 z = (
Real)afCoordinate[2];
81 : x( r[0] ), y( r[1] ), z( r[2] )
102 inline Real operator [] (
const size_t i )
const
109 inline Real& operator [] (
const size_t i )
150 return ( x == rkVector.
x && y == rkVector.
y && z == rkVector.
z );
155 return ( x != rkVector.
x || y != rkVector.
y || z != rkVector.
z );
193 assert( fScalar != 0.0 );
195 Real fInv = 1.0f / fScalar;
225 fScalar * rkVector.
x,
226 fScalar * rkVector.
y,
227 fScalar * rkVector.
z);
233 fScalar / rkVector.
x,
234 fScalar / rkVector.
y,
235 fScalar / rkVector.
z);
324 assert( fScalar != 0.0 );
326 Real fInv = 1.0f / fScalar;
369 return x * x + y * y + z * z;
381 return (*
this - rhs).length();
396 return (*
this - rhs).squaredLength();
415 return x * vec.
x + y * vec.
y + z * vec.
z;
449 if ( fLength >
Real(0.0f) )
451 Real fInvLength = 1.0f / fLength;
491 y * rkVector.
z - z * rkVector.
y,
492 z * rkVector.
x - x * rkVector.
z,
493 x * rkVector.
y - y * rkVector.
x);
502 ( x + vec.
x ) * 0.5f,
503 ( y + vec.
y ) * 0.5f,
504 ( z + vec.
z ) * 0.5f );
512 if( x < rhs.
x && y < rhs.
y && z < rhs.
z )
520 inline bool operator > (
const Vector3& rhs )
const
522 if( x > rhs.
x && y > rhs.
y && z > rhs.
z )
536 if( cmp.
x < x ) x = cmp.
x;
537 if( cmp.
y < y ) y = cmp.
y;
538 if( cmp.
z < z ) z = cmp.
z;
550 if( cmp.
x > x ) x = cmp.
x;
551 if( cmp.
y > y ) y = cmp.
y;
552 if( cmp.
z > z ) z = cmp.
z;
564 static const Real fSquareZero = (
Real)(1e-06 * 1e-06);
608 newUp = this->perpendicular();
634 if(lenProduct < 1e-6f)
637 Real f = dotProduct(dest) / lenProduct;
668 if (d < (1e-6f - 1.0f))
704 Real sqlen = (x * x) + (y * y) + (z * z);
705 return (sqlen < (1e-06 * 1e-06));
723 return Vector3( *
this - ( 2 * this->dotProduct(normal) * normal ) );
748 return squaredDistance(rhs) <=
760 const Radian& tolerance)
const
762 Real dot = dotProduct(rhs);
807 inline _OgreExport friend std::ostream&
operator <<
810 o <<
"Vector3(" << v.x <<
", " << v.y <<
", " << v.z <<
")";