22 template <
class T>
class DtVector3;
36 :
x(rhs.
x),
y(rhs.
y),
z(rhs.
z),
w(_w) {}
50 const void*
ptr(
void)
const{
return &
x;}
105 return DtVector4<T>(x+fScalar, y+fScalar, z+fScalar, w+fScalar);
110 return DtVector4<T>(x-fScalar, y-fScalar, z-fScalar, w-fScalar);
116 return DtVector4<T>(x*fScalar, y*fScalar, z*fScalar, w*fScalar);
122 T OneByfScalar = T(1.0)/fScalar;
123 return DtVector4<T>(x*OneByfScalar, y*OneByfScalar, z*OneByfScalar, w*OneByfScalar);
141 const T* ptrT =
static_cast<const T*
>(ptr());
186 return this->operator*=(T(1.0)/fScalar);
192 return x == rhs.x&&y == rhs.y && z == rhs.z && w==rhs.w;
199 return !(lhs == rhs);
203 inline std::ostream& operator <<( std::ostream& o, const DtVector4<T>& v )
205 o <<
"Vector4(" << v.
x <<
", " << v.y <<
", " << v.z <<
", " << v.w <<
")";
const void * ptr(void) const
access the pointer to the data
Definition: DtVector4.h:50
DtVector4< uint32 > Vector4_uint32
Definition: DtVector4.h:217
DtVector4 & operator-=(T fScalar)
subtract a scalar from this vector
Definition: DtVector4.h:164
~DtVector4()
DTOR.
Definition: DtVector4.h:44
T x
Definition: DtVector4.h:95
const T * typePtr(void) const
access the pointer to the data, with the type of the data
Definition: DtVector4.h:53
bool operator==(const DtVector4 &rhs) const
equality
Definition: DtVector4.h:190
std::list< Vector4_32 > Vector4_32_List
Definition: DtVector4.h:99
DtVector4(const DtVector3< T > &rhs, T _w)
CTOR.
Definition: DtVector4.h:35
bool operator!=(const DtVector4 &rhs) const
inequality
Definition: DtVector4.h:196
DtVector4 & operator*=(T fScalar)
multiply a scalar to this vector
Definition: DtVector4.h:174
DtVector4< int32 > Vector4_int
Definition: DtVector4.h:216
T x
Definition: DtVector3.h:132
DtVector4 operator+(T fScalar) const
add a scalar to this vector
Definition: DtVector4.h:103
DtVector4 operator/(T fScalar) const
divide this vector by a scalar
Definition: DtVector4.h:120
4 dimensional vector
Definition: DtMath.h:22
std::vector< Vector4_32 > Vector4_32_Vector
Definition: DtVector4.h:100
T operator[](size_t index) const
access a component of this vector
Definition: DtVector4.h:138
DtVector4(const T1 &v)
CTOR construct from type with constructable components.
Definition: DtVector4.h:41
T z
Definition: DtVector4.h:95
std::list< Vector4_64 > Vector4_64_List
Definition: DtVector4.h:222
DtVector4 & operator+=(T fScalar)
add a scalar to this vector
Definition: DtVector4.h:154
bool isEqual(const DtVector4 &rhs, T tolerance) const
is this vector == to rhs within the tolerance/epsilon
Definition: DtVector4.h:128
static size_t sizeInBytes(void)
Definition: DtVector4.h:210
T w
Definition: DtVector4.h:95
DtVector4 operator-(void) const
get the negated version of this vector
Definition: DtVector4.h:56
static bool isEqual(int32 lhs, int32 rhs, int32 tolerance=std::numeric_limits< int32 >::epsilon())
Test equality with tolerance.
std::vector< Vector4_64 > Vector4_64_Vector
Definition: DtVector4.h:223
DtVector4(T _x, T _y, T _z, T _w)
CTOR.
Definition: DtVector4.h:33
2 dimensional vector
Definition: DtMath.h:21
DtVector4< float32 > Vector4_32
Definition: DtVector4.h:98
DtVector4()
CTOR.
Definition: DtVector4.h:31
DtVector4 operator*(T fScalar) const
multiply a scalar to this vector
Definition: DtVector4.h:114
#define ASSERT_PREDICATE(p)
Definition: DtAssert.h:28
DtVector4< float64 > Vector4_64
Definition: DtVector4.h:221
T y
Definition: DtVector4.h:95
DtVector4 & operator/=(T fScalar)
divide this vector by a scalar
Definition: DtVector4.h:184