#include <tvector.h>
Inheritance diagram for salt::TVector< DATATYPE, ELEMENTS, TYPE >:
Public Member Functions | |
TVector () | |
f_inline DATATYPE & | operator[] (int row) |
returns a reference to a row of the vector | |
f_inline const DATATYPE & | operator[] (int row) const |
returns a constant reference to a row of a vector | |
f_inline DATATYPE & | Get (int row) |
returns a reference to a row of a vector | |
f_inline const DATATYPE & | Get (int row) const |
returns a constant reference to a row of a vector | |
f_inline const TYPE & | SetData (const DATATYPE *copy) |
copies another vector 'copy' | |
f_inline DATATYPE * | GetData () |
return a pointer to the encapsulated vector | |
void | Dump () const |
prints the contents of vector to stdout | |
f_inline const TYPE & | Fill (const DATATYPE &fill) |
fills all components of the vector with value 'fill' | |
f_inline TYPE & | Zero () |
sets all components of the vector to 0 | |
f_inline const TYPE | operator+ (const TYPE &v) const |
calculates this VECTOR + VECTOR | |
f_inline const TYPE | operator- (const TYPE &v) const |
calculates VECTOR - VECTOR | |
f_inline const TYPE | operator * (const DATATYPE &v) const |
calculates VECTOR * VECTOR | |
f_inline const TYPE | operator/ (const DATATYPE &v) const |
calculates VECTOR / SCALAR | |
f_inline TYPE & | operator+= (const TYPE &v) |
add another vector | |
f_inline TYPE & | operator-= (const TYPE &v) |
substracts another vector | |
f_inline TYPE & | operator *= (const DATATYPE &v) |
multiplies another vector | |
f_inline TYPE & | operator/= (const DATATYPE &v) |
divides another vector | |
f_inline TYPE | operator- () const |
returns the negate of this vector | |
f_inline bool | operator== (const TYPE &v) const |
returns true if this vector and v are equal | |
f_inline bool | operator!= (const TYPE &v) const |
returns true if this vector and v are not equal | |
f_inline DATATYPE | Dot (const TYPE &v) const |
returns the dot product from this vector and v | |
f_inline const TYPE & | Normalize () |
normalizes the vector | |
f_inline TYPE | Normalized () const |
calculates the normalized vector, not modifying the vector | |
f_inline DATATYPE | SquareLength () const |
calculates the squared length of the vector | |
f_inline DATATYPE | Length () const |
calculates the length of the vector | |
f_inline int | GetLeastSignificantAxis () const |
returns the index of least significant axis | |
f_inline int | GetMostSignificantAxis () const |
returns the index of the most significant axis | |
f_inline TYPE | LinearInterpolate (const TYPE &to, float delta) const |
lineary interpolates between this vector and to with an delta increment | |
f_inline TYPE | NormalizedLinearInterpolate (const TYPE &to, float delta) const |
lineary interpolates between this vector and to with an delta increment, returning a normalized vector | |
Protected Member Functions | |
TVector (const TYPE &v) | |
const DATATYPE & | El (int index) const |
DATATYPE & | El (int index) |
Private Attributes | |
DATATYPE | mData [ELEMENTS] |
It abstracts away the number of elements and their type.
Definition at line 51 of file tvector.h.
|
|
|
|
|
returns the dot product from this vector and v
Definition at line 460 of file tvector.h. References salt::TVector< DATATYPE, ELEMENTS, TYPE >::mData. Referenced by salt::BoundingSphere::Encapsulate(), salt::BoundingSphere::EncapsulateFast(), salt::Plane::GetDistanceTo(), salt::Plane::GetOrientation(), salt::Plane::Plane(), salt::Plane::Set(), and oxygen::PlaneCollider::SetParams(). |
|
prints the contents of vector to stdout
Definition at line 322 of file tvector.h. References salt::TVector< DATATYPE, ELEMENTS, TYPE >::mData. |
|
|
|
Definition at line 172 of file tvector.h. Referenced by salt::TVector< float, 3, Vector3f >::Get(), and salt::TVector< float, 3, Vector3f >::operator[](). |
|
fills all components of the vector with value 'fill'
Definition at line 331 of file tvector.h. References salt::TVector< DATATYPE, ELEMENTS, TYPE >::mData. |
|
returns a constant reference to a row of a vector
|
|
returns a reference to a row of a vector
|
|
return a pointer to the encapsulated vector
|
|
returns the index of least significant axis
|
|
returns the index of the most significant axis
|
|
|
lineary interpolates between this vector and to with an delta increment
Definition at line 502 of file tvector.h. References salt::TVector< DATATYPE, ELEMENTS, TYPE >::mData. Referenced by salt::TVector< float, 3, Vector3f >::NormalizedLinearInterpolate(). |
|
normalizes the vector
Definition at line 470 of file tvector.h. References salt::TVector< DATATYPE, ELEMENTS, TYPE >::Length(), and salt::TVector< DATATYPE, ELEMENTS, TYPE >::mData. Referenced by salt::Matrix::LookAt(), oxygen::VelocityController::PrePhysicsUpdateInternal(), DriveEffector::Realize(), and oxygen::PlaneCollider::SetParams(). Here is the call graph for this function: ![]() |
|
calculates the normalized vector, not modifying the vector
Definition at line 480 of file tvector.h. References salt::TVector< DATATYPE, ELEMENTS, TYPE >::Length(), and salt::TVector< DATATYPE, ELEMENTS, TYPE >::mData. Referenced by salt::BoundingSphere::Encapsulate(), salt::Matrix::LookAt(), salt::Plane::Plane(), and salt::Plane::Set(). Here is the call graph for this function: ![]() |
|
lineary interpolates between this vector and to with an delta increment, returning a normalized vector
|
|
calculates VECTOR * VECTOR
Definition at line 379 of file tvector.h. References salt::TVector< DATATYPE, ELEMENTS, TYPE >::mData. |
|
multiplies another vector
Definition at line 418 of file tvector.h. References salt::TVector< DATATYPE, ELEMENTS, TYPE >::mData. |
|
returns true if this vector and v are not equal
|
|
calculates this VECTOR + VECTOR
Definition at line 357 of file tvector.h. References salt::TVector< DATATYPE, ELEMENTS, TYPE >::mData. |
|
add another vector
Definition at line 400 of file tvector.h. References salt::TVector< DATATYPE, ELEMENTS, TYPE >::mData. |
|
returns the negate of this vector
Definition at line 436 of file tvector.h. References salt::TVector< DATATYPE, ELEMENTS, TYPE >::mData. |
|
calculates VECTOR - VECTOR
Definition at line 368 of file tvector.h. References salt::TVector< DATATYPE, ELEMENTS, TYPE >::mData. |
|
substracts another vector
Definition at line 409 of file tvector.h. References salt::TVector< DATATYPE, ELEMENTS, TYPE >::mData. |
|
calculates VECTOR / SCALAR
Definition at line 390 of file tvector.h. References salt::TVector< DATATYPE, ELEMENTS, TYPE >::mData. |
|
divides another vector
Definition at line 427 of file tvector.h. References salt::TVector< DATATYPE, ELEMENTS, TYPE >::mData. |
|
returns true if this vector and v are equal
|
|
returns a constant reference to a row of a vector
|
|
returns a reference to a row of the vector
|
|
copies another vector 'copy'
Definition at line 313 of file tvector.h. References salt::TVector< DATATYPE, ELEMENTS, TYPE >::mData. |
|
calculates the squared length of the vector
Definition at line 492 of file tvector.h. References salt::TVector< DATATYPE, ELEMENTS, TYPE >::mData. Referenced by salt::TVector< float, 3, Vector3f >::Length(), oxygen::VelocityController::PrePhysicsUpdateInternal(), oxygen::FPSController::PrePhysicsUpdateInternal(), and DriveEffector::Realize(). |
|
sets all components of the vector to 0
Definition at line 340 of file tvector.h. References salt::TVector< DATATYPE, ELEMENTS, TYPE >::mData. |
|