#include <tb_vector.hpp>
Public Member Functions | |
| TypedVector3 (const SkipInitialization &fastAndStupid) | |
| TypedVector3 (void) | |
| TypedVector3 (const Type valueX, const Type valueY, const Type valueZ) | |
| TypedVector3 (const TypedVector2< Type > &other, const Type valueZ) | |
| TypedVector3 (const Type *componentArray) | |
| TypedVector3 (const TypedVector3< Type > &other) | |
| template<typename FromType > | |
| TypedVector3 (const TypedVector3< FromType > &other) | |
| ~TypedVector3 (void) | |
| TypedVector3 & | operator= (const TypedVector3 &other) |
| bool | operator== (const TypedVector3 &other) const |
| bool | operator!= (const TypedVector3 &other) const |
| operator const Type * (void) const | |
| operator Type * (void) | |
| template<typename ToType > | |
| operator TypedVector3< ToType > (void) const | |
| const Type & | operator[] (const int index) const |
| const Type & | operator[] (const std::size_t &index) const |
| Type & | operator[] (const int index) |
| Type & | operator[] (const std::size_t &index) |
Static Public Member Functions | |
| static TypedVector3 | Zero (void) |
| static TypedVector3 | One (void) |
| static TypedVector3 | Right (void) |
| static TypedVector3 | Left (void) |
| static TypedVector3 | Up (void) |
| static TypedVector3 | Down (void) |
| static TypedVector3 | Forward (void) |
| static TypedVector3 | Backward (void) |
| static Type | Dot (const TypedVector3< Type > &leftSide, const TypedVector3< Type > &rightSide) |
| static TypedVector3 | Cross (const TypedVector3< Type > &leftSide, const TypedVector3< Type > &rightSide) |
| static TypedVector3 | Normalize (const TypedVector3< Type > &value) |
| static TypedVector3 | Normalize (const TypedVector3< Type > &value, Type &magnitude) |
Public Attributes | |
| union { | |
| Type mComponents [3] | |
| struct { | |
| Type x | |
| Type y | |
| Type z | |
| } | |
| }; | |
The TypedVector3 object is a three component mathematical vector of Types packed together with some functionality to perform basic vector math.
|
inlineexplicit |
Constructs a TypedVector3 object leaving the members uninitialized and must be initialized manually before the object is used.
|
inline |
Constructs a default TypedVector3 object with all components set to Type(0).
|
inline |
Constructs a TypedVector3 object with each component initialized with the values provided.
| valueX | The value to initialize the x component as. |
| valueY | The value to initialize the y component as. |
| valueZ | The value to initialize the z component as. |
|
inlineexplicit |
Constructs a TypedVector3 object by copying a TypedVector2 object and providing a value for the Z component.
| other | The TypedVector2 object to initialize the x and y component values to. |
| valueZ | The value to initialize the z component as. |
|
inlineexplicit |
Constructs a TypedVector3 object with the supplied Type array, which must contain at least 3 Types.
| componentArray | Must have at least 3 Types, one for each component in the TypedVector3. |
|
inline |
Constructs a TypedVector3 object by copying another TypedVector3 object, each component will be initialized to the value of the other components.
| other | The TypedVector3 object to initialize component values to. |
|
inline |
Nothing needs to happen to destroy a TypedVector3 object.
|
inlinestatic |
Perform a cross product on two TypedVector3 objects, returning the TypedVector3 result that is perpendicular two the two given vectors.
|
inlinestatic |
Perform a dot product on two TypedVector3 objects, returning the scalar result.
|
inlinestatic |
Take a Vector3 and returns a unit length vector in the same direction.
|
inlinestatic |
Take a Vector3 and returns a unit length vector in the same direction while also returning the original magnitude.
|
inlinestatic |
Creates and returns a TypedVector3 object representing 1, 1, 1
|
inlineexplicit |
Returns a Type array of the TypedVector3 components.
|
inlineexplicit |
Returns a Type array of the TypedVector3 components. If modified the internal components will also be modified as well.
|
inline |
Casts a Vector to Vector to move from float to double or such.
|
inline |
Inequality operator, returns the opposite of the equality operator, which compares each value in one TypedVector3 object to another using IsEqual to compare the floating point component values.
|
inline |
Assignment operator, sets each component of the TypedVector3 object to the values of the other object.
| other | The TypedVector3 object to set the components to. |
|
inline |
Equality operator, compares each component of the TypedVector3 object to the values of another TypedVector3 returning true if all components are equal, or false if any of the components are not equal.
| other | The TypedVector3 object to compare against. |
|
inline |
Returns a reference to one of the TypedVector3 components by an index provided by the VectorComponent enum. If the reference returned is modified, the internal components will also be modified as well.
|
inline |
Returns a reference to one of the TypedVector3 components by an index provided by the VectorComponent enum.
|
inlinestatic |
Creates and returns a TypedVector3 object representing Type(0), Type(0), Type(0).