47 const void*
ptr(
void)
const
65 bool isEqual(
const DtVector3& rhs, T tolerance = std::numeric_limits<T>::min())
const;
163 , std::numeric_limits<T>::max()
164 , std::numeric_limits<T>::max());
172 T fInvLength = 1.0f / fLength;
188 return x * x + y * y + z * z;
195 return (*
this - rhs).length();
206 return DtVector3<T>(x - rhs.x, y - rhs.y, z - rhs.z);
212 return DtVector3<T>(x + fScalar, y + fScalar, z + fScalar);
217 return DtVector3<T>(x - fScalar, y - fScalar, z - fScalar);
229 T OneByfScalar = T(1.0) / fScalar;
230 return DtVector3<T>(x*OneByfScalar, y*OneByfScalar, z*OneByfScalar);
236 return x > rhs.x && y > rhs.y && z > rhs.z;
242 return x < rhs.x && y < rhs.y && z < rhs.z;
262 , z*rhs.x - x * rhs.z
263 , x*rhs.y - y * rhs.x
270 return x * rhs.x + y * rhs.y + z * rhs.z;
283 , (y + rhs.y)*static_cast<T>(0.5)
284 , (z + rhs.z)*static_cast<T>(0.5)
293 const T* ptrT =
static_cast<const T*
>(ptr());
308 if (rhs.x > x) x = rhs.x;
309 if (rhs.y > y) y = rhs.y;
310 if (rhs.z > z) z = rhs.z;
315 if (rhs.x < x) x = rhs.x;
316 if (rhs.y < y) y = rhs.y;
317 if (rhs.z < z) z = rhs.z;
368 return this->operator*=(T(1.0) / fScalar);
374 return x == rhs.x&&y == rhs.y&&z == rhs.z;
381 return !(lhs == rhs);
385 inline std::ostream& operator <<(std::ostream& o, const DtVector3<T>& v)
387 o <<
"Vector3(" << v.
x <<
" " << v.y <<
" " << v.z <<
")";
394 return 3 *
sizeof(T);
DtVector3 & operator-=(const DtVector3 &rhs)
component wise subtract rhs
bool operator<(const DtVector3 &rhs) const
Return true if each component lessser than the corresponding component of rhs.
Definition: DtVector3.h:240
void makeCeil(const DtVector3 &rhs)
Each component = max(component, rhs.component)
Definition: DtVector3.h:306
DtVector3(T _x, T _y, T _z)
CTOR.
Definition: DtVector3.h:32
DtVector3()
CTOR.
Definition: DtVector3.h:30
DtVector3 & operator+=(const DtVector3 &rhs)
component wise add rhs
DtVector3 & operator*=(T fScalar)
multiply a scalar to each component
Definition: DtVector3.h:357
DtVector3 crossProduct(const DtVector3 &rhs) const
get the cross product of this vector and rhs
Definition: DtVector3.h:255
bool operator!=(const DtVector3 &rhs) const
inequality
Definition: DtVector3.h:378
DtVector3< float64 > Vector3_64
Definition: DtVector3.h:412
static const DtVector3 theUnitScale
Definition: DtVector3.h:138
T dotProduct(const DtVector3 &rhs) const
get the dot product of this vector and rhs
Definition: DtVector3.h:268
static const DtVector3 Z_AXIS
Definition: DtVector3.h:141
static T Sqrt(T val)
Standard math routines.
Definition: DtMath.h:58
DtVector3 operator*(T fScalar) const
multiply a scalar to each component
Definition: DtVector3.h:221
DtVector3 operator/(T fScalar) const
divide each component by a scalar
Definition: DtVector3.h:227
std::list< Vector3_32 > Vector3_32_List
Definition: DtVector3.h:147
T z
Definition: DtVector3.h:135
const T * typePtr(void) const
access the pointer to the data, with the type of the data
Definition: DtVector3.h:53
DtVector3 midPoint(const DtVector3 &rhs) const
get the midpoint between this vector and rhs
Definition: DtVector3.h:280
static const DtVector3 X_AXIS
Definition: DtVector3.h:139
T x
Definition: DtVector3.h:135
DtVector3 operator+(const DtVector3 &rhs) const
component wise add two vectors together
std::list< Vector3_64 > Vector3_64_List
Definition: DtVector3.h:413
bool operator==(const DtVector3 &rhs) const
equality
Definition: DtVector3.h:372
DtVector3< float32 > Vector3_32
Definition: DtVector3.h:146
void makeFloor(const DtVector3 &rhs)
Each component = min(component, rhs.component)
Definition: DtVector3.h:313
T operator[](size_t index) const
access a component of this vector
Definition: DtVector3.h:290
static const DtVector3 Y_AXIS
Definition: DtVector3.h:140
DtVector3< int32 > Vector3_int
Definition: DtVector3.h:405
T y
Definition: DtVector3.h:135
static size_t sizeInBytes(void)
Definition: DtVector3.h:392
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)
normalize this vector in place
Definition: DtVector3.h:167
DtVector3< uint32 > Vector3_uint32
Definition: DtVector3.h:407
void set(T x, T y, T z)
set values
Definition: DtVector3.h:398
DtVector3 & operator/=(T fScalar)
divide each component by a scalar
Definition: DtVector3.h:366
2 dimensional vector
Definition: DtMath.h:21
std::vector< Vector3_64 > Vector3_64_Vector
Definition: DtVector3.h:414
T squaredLength(void) const
get the length squared of this vector
Definition: DtVector3.h:186
static const DtVector3 theZeroVector
Definition: DtVector3.h:137
T absDotProduct(const DtVector3 &rhs) const
get the abs dot product of this vector and rhs
Definition: DtVector3.h:274
#define ASSERT_PREDICATE(p)
Definition: DtAssert.h:28
std::vector< Vector3_32 > Vector3_32_Vector
Definition: DtVector3.h:148
bool operator>(const DtVector3 &rhs) const
Return true if each component greater than the corresponding component of rhs.
Definition: DtVector3.h:234
T length(void) const
get the length of this vector
Definition: DtVector3.h:180
T getDistance(const DtVector3 &rhs) const
get the distance between this vector and rhs
Definition: DtVector3.h:193
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:56
bool isEqual(const DtVector3 &rhs, T tolerance=std::numeric_limits< T >::min()) const
is rhs == to this vector within a specified tolerance/epsilon
Definition: DtVector3.h:246
static T Abs(T val)
Standard math routines.
Definition: DtMath.h:59
static DtVector3 POSITIVE_INFINITY
Definition: DtVector3.h:143
const void * ptr(void) const
Definition: DtVector3.h:47