44 const void*
ptr(
void)
const
122 return DtVector2<T>(x-rhs.x, y-rhs.y);
162 T OneByfScalar = T(1.0)/fScalar;
184 return x*rhs.x + y*rhs.y;
193 T fInvLength = 1.0f / fLength;
202 T vecLength = length();
203 if (vecLength<std::numeric_limits<T>::epsilon())
206 T one_by_length = T(1.0)/vecLength;
214 const T* ptrT =
static_cast<const T*
>(ptr());
239 return x == rhs.x&&y == rhs.y;
246 return !(lhs == rhs);
std::list< Vector2_32 > Vector2_32_List
Definition: DtVector2.h:251
bool isEqual(const DtVector2 &rhs, T tolerance) const
is rhs == to this vector within a specified tolerance/epsilon
Definition: DtVector2.h:173
DtVector2(T _x, T _y)
CTOR.
Definition: DtVector2.h:30
DtVector2 operator*(T fScalar) const
multiply a scalar to each component
Definition: DtVector2.h:154
static size_t sizeInBytes(void)
Definition: DtVector2.h:231
T squaredLength(void) const
get the length of the vector squared
Definition: DtVector2.h:225
DtVector2 operator+(const DtVector2 &rhs) const
component wise add two vectors together
T getDotProduct(const DtVector2 &rhs) const
get the dot product of this vector with rhs
Definition: DtVector2.h:182
std::list< Vector2_64 > Vector2_64_List
Definition: DtVector2.h:259
DtVector2 getNormalizedCopy(void) const
get a normalized copy of this vector
Definition: DtVector2.h:200
DtVector2 operator-(const DtVector2 &rhs) const
component wise subtract two vectors
static const DtVector2 theZeroVector
Definition: DtVector2.h:104
static const DtVector2 theUnitScale
Definition: DtVector2.h:105
DtVector2< int32 > Vector2_int
Definition: DtVector2.h:254
static T Sqrt(T val)
Standard math routines.
Definition: DtMath.h:58
T y
Definition: DtVector2.h:101
T length(void) const
get the length of the vector
Definition: DtVector2.h:219
DtVector2(const T1 &v)
CTOR construct from type with constructable components.
Definition: DtVector2.h:35
DtVector2 & operator+=(const DtVector2 &rhs)
component wise add rhs
Definition: DtVector2.h:126
DtVector2 operator/(T fScalar) const
divide each component by a scalar
Definition: DtVector2.h:160
~DtVector2()
DTOR.
Definition: DtVector2.h:38
std::vector< Vector2_64 > Vector2_64_Vector
Definition: DtVector2.h:260
static bool isEqual(int32 lhs, int32 rhs, int32 tolerance=std::numeric_limits< int32 >::epsilon())
Test equality with tolerance.
DtVector2< uint32 > Vector2_uint32
Definition: DtVector2.h:255
bool operator==(const DtVector2 &rhs) const
equality
Definition: DtVector2.h:237
#define ASSERT_PREDICATE_RETURN_DEFAULT_CONSTRUCTOR(V, p)
Definition: DtAssert.h:45
void normalize(void)
normalize this vector in place
Definition: DtVector2.h:188
DtVector2()
CTOR.
Definition: DtVector2.h:28
bool operator!=(const DtVector2 &rhs) const
inequality
Definition: DtVector2.h:243
T x
Definition: DtVector2.h:101
T operator[](size_t index) const
access a component of the vector
Definition: DtVector2.h:211
DtVector2< float32 > Vector2_32
Definition: DtVector2.h:250
DtVector2 & operator-=(const DtVector2 &rhs)
component wise subtract rhs
Definition: DtVector2.h:134
DtVector2< float64 > Vector2_64
Definition: DtVector2.h:258
std::vector< Vector2_32 > Vector2_32_Vector
Definition: DtVector2.h:252
const void * ptr(void) const
get a pointer to the data
Definition: DtVector2.h:44
2 dimensional vector
Definition: DtMath.h:20