42 const void*
ptr(
void)
const{
return &
x;}
47 bool isEqual(
const DtVector3& rhs, T tolerance=std::numeric_limits<T>::min())
const;
117 ,std::numeric_limits<T>::max()
118 ,std::numeric_limits<T>::max());
126 T fInvLength = 1.0f/fLength;
149 return (*
this-rhs).length();
160 return DtVector3<T>(x-rhs.x, y-rhs.y, z-rhs.z);
183 T OneByfScalar = T(1.0)/fScalar;
184 return DtVector3<T>(x*OneByfScalar, y*OneByfScalar, z*OneByfScalar);
190 return x>rhs.
x && y>rhs.
y && z>rhs.
z;
196 return x<rhs.
x && y<rhs.
y && z<rhs.
z;
224 return x*rhs.
x + y*rhs.
y + z*rhs.
z;
237 , (y+rhs.
y)*static_cast<T>(0.5)
238 , (z+rhs.
z)*static_cast<T>(0.5)
247 const T* ptrT =
static_cast<const T*
>(ptr());
262 if( rhs.
x > x ) x = rhs.
x;
263 if( rhs.
y > y ) y = rhs.
y;
264 if( rhs.
z > z ) z = rhs.
z;
269 if( rhs.
x < x ) x = rhs.
x;
270 if( rhs.
y < y ) y = rhs.
y;
271 if( rhs.
z < z ) z = rhs.
z;
304 return this->operator*=(T(1.0)/fScalar);
308 inline std::ostream& operator <<( std::ostream& o, const DtVector3<T>& v )
310 o <<
"Vector3(" << v.x <<
", " << v.y <<
", " << v.z <<
")";
bool operator<(const DtVector3 &rhs) const
Return true if each component lessser than the corresponding component of rhs.
Definition: DtVector3.h:194
void makeCeil(const DtVector3 &rhs)
Each component = max(component, rhs.component)
Definition: DtVector3.h:260
DtVector3(T _x, T _y, T _z)
CTOR.
Definition: DtVector3.h:32
DtVector3 & operator-=(T fScalar)
Definition: DtVector3.h:284
DtVector3()
CTOR.
Definition: DtVector3.h:30
DtVector3 & operator*=(T fScalar)
Definition: DtVector3.h:293
DtVector3 crossProduct(const DtVector3 &rhs) const
Definition: DtVector3.h:209
T dotProduct(const DtVector3 &rhs) const
Definition: DtVector3.h:222
static DtVector3 X_AXIS
Definition: DtVector3.h:91
static T Sqrt(T val)
Standard math routines.
Definition: DtMath.h:54
DtVector3 operator*(T fScalar) const
Definition: DtVector3.h:175
DtVector3 operator/(T fScalar) const
Definition: DtVector3.h:181
std::list< Vector3_32 > Vector3_32_List
Definition: DtVector3.h:101
T z
Definition: DtVector3.h:87
DtVector3 midPoint(const DtVector3 &rhs) const
Definition: DtVector3.h:234
T x
Definition: DtVector3.h:87
DtVector3 operator+(const DtVector3 &rhs) const
static DtVector3 ZERO_VECTOR
Definition: DtVector3.h:89
DtVector3< float32 > Vector3_32
Definition: DtVector3.h:100
static DtVector3 UNIT_SCALE
Definition: DtVector3.h:90
void makeFloor(const DtVector3 &rhs)
Each component = min(component, rhs.component)
Definition: DtVector3.h:267
T operator[](size_t index) const
Definition: DtVector3.h:244
static DtVector3 Z_AXIS
Definition: DtVector3.h:93
T y
Definition: DtVector3.h:87
static size_t sizeInBytes(void)
Definition: DtVector3.h:315
static DtVector3 Y_AXIS
Definition: DtVector3.h:92
static bool isEqual(int32 lhs, int32 rhs, int32 tolerance=std::numeric_limits< int32 >::epsilon())
Test equality with tolerance.
~DtVector3()
DTOR.
Definition: DtVector3.h:40
void normalize(void)
Definition: DtVector3.h:121
#define ASSERT_PREDICATE_RETURN_DEFAULT_CONSTRUCTOR(V, p)
Definition: DtAssert.h:45
DtVector3 & operator/=(T fScalar)
Definition: DtVector3.h:302
2 dimensional vector
Definition: DtVector3.h:26
T squaredLength(void) const
Definition: DtVector3.h:140
T absDotProduct(const DtVector3 &rhs) const
Definition: DtVector3.h:228
#define ASSERT_PREDICATE(p)
Definition: DtAssert.h:28
std::vector< Vector3_32 > Vector3_32_Vector
Definition: DtVector3.h:102
DtVector3 & operator+=(T fScalar)
Definition: DtVector3.h:275
bool operator>(const DtVector3 &rhs) const
Return true if each component greater than the corresponding component of rhs.
Definition: DtVector3.h:188
T length(void) const
Definition: DtVector3.h:134
T getDistance(const DtVector3 &rhs) const
Definition: DtVector3.h:147
DtVector3(const T1 &v)
CTOR construct from type with constructable components.
Definition: DtVector3.h:37
DtVector3 operator-(void) const
Negate the vector.
Definition: DtVector3.h:45
bool isEqual(const DtVector3 &rhs, T tolerance=std::numeric_limits< T >::min()) const
Definition: DtVector3.h:200
static T Abs(T val)
Definition: DtMath.h:55
static DtVector3 POSITIVE_INFINITY
Definition: DtVector3.h:95
const void * ptr(void) const
Definition: DtVector3.h:42