#include <Vector3.h>
Public Member Functions | |
| Vector3 (void) | |
| Vector3 (const Vector3 &v) | |
| Vector3 & | operator= (const Vector3 &v) |
| void | swap (Vector3 &v) |
| ~Vector3 (void) | |
| Vector3 (const float x, const float y, const float z) | |
| Vector3 (const float c) | |
| const float | length () const |
| const float | lensqr () const |
| const Vector3 | normalized () const |
| const Vector3 | abs () const |
| const float | operator[] (unsigned index) const |
| float & | operator[] (unsigned index) |
| const Vector3 | operator- () const |
| const Vector3 | operator+ (const Vector3 &v) const |
| const Vector3 | operator- (const Vector3 &v) const |
| const Vector3 | operator* (const float s) const |
| const Vector3 | operator* (const Vector3 &v) const |
| const float | dot (const Vector3 &v) const |
| const float | dotsqr (const Vector3 &v) const |
| const Vector3 | cross (const Vector3 &v) const |
| const float | comp (const Vector3 &v) const |
| const Vector3 | proj (const Vector3 &v) const |
| const Vector3 | x__ () const |
| const Vector3 | _y_ () const |
| const Vector3 | __z () const |
| const Vector3 | xy_ () const |
| const Vector3 | x_z () const |
| const Vector3 | _yz () const |
| const Vector3 | xxx () const |
| const Vector3 | yyy () const |
| const Vector3 | zzz () const |
| Vector3 & | operator+= (const Vector3 &v) |
| Vector3 & | operator-= (const Vector3 &v) |
| Vector3 & | operator*= (const float s) |
| Vector3 & | operator*= (const Vector3 &v) |
| Vector3 & | clear () |
| Vector3 & | invert () |
| Vector3 & | normalize () |
| Vector3 & | add (const Vector3 &v, const float s) |
| Vector3 & | mad (const float s, const Vector3 &v) |
| Vector3 & | mul (const Vector3 &v) |
| const bool | operator== (const Vector3 &v) const |
| const bool | operator!= (const Vector3 &v) const |
| const bool | operator< (const Vector3 &v) const |
| const bool | operator> (const Vector3 &v) const |
| const bool | operator<= (const Vector3 &v) const |
| const bool | operator>= (const Vector3 &v) const |
| operator const float *const () const | |
| operator float *const () | |
Static Public Member Functions | |
| static Vector3 | abs1 (const Vector3 &v) |
| static Vector3 | min2 (const Vector3 &a, const Vector3 &b) |
| static Vector3 | max2 (const Vector3 &a, const Vector3 &b) |
Public Attributes | |
| union { | |
| struct { | |
| float x | |
| float y | |
| float z | |
| } | |
| float data [3] | |
| }; | |
Static Public Attributes | |
| static const Vector3 | X = Vector3( 1, 0, 0 ) |
| static const Vector3 | Y = Vector3( 0, 1, 0 ) |
| static const Vector3 | Z = Vector3( 0, 0, 1 ) |
Represents a vector with three dimensions x, y and z. Used for 3d-physics and -graphics.
| ml7::Vector3::Vector3 | ( | void | ) | [inline] |
Default constructor. Creates a new vector with x = y = z = 0.
| ml7::Vector3::Vector3 | ( | const Vector3 & | v | ) | [inline] |
Copy constructor. Creates a new vector with x = v.x, ... , z = v.z.
| ml7::Vector3::~Vector3 | ( | void | ) | [inline] |
Destructor.
| ml7::Vector3::Vector3 | ( | const float | x, | |
| const float | y, | |||
| const float | z | |||
| ) | [inline] |
Explicit constructor with parameters for x, y and z.
| ml7::Vector3::Vector3 | ( | const float | c | ) | [inline, explicit] |
Explicit constructor with one parameter for all components x, y and z.
| const Vector3 ml7::Vector3::__z | ( | ) | const [inline] |
Returns a new vector with the z component of this (x = y = 0).
| const Vector3 ml7::Vector3::_y_ | ( | ) | const [inline] |
Returns a new vector with the y component of this (x = z = 0).
| const Vector3 ml7::Vector3::_yz | ( | ) | const [inline] |
Returns a new vector with the z component of this (x = y = 0).
| const Vector3 ml7::Vector3::abs | ( | ) | const [inline] |
Returns this vector having positive components.
Returns a copy of a given vector having positive components.
Adds a given vector v scaled by a given scalar s to this.
| Vector3& ml7::Vector3::clear | ( | ) | [inline] |
Sets x = y = z = 0.
| const float ml7::Vector3::comp | ( | const Vector3 & | v | ) | const [inline] |
Returns the scalar projection of a given vector v onto this.
Returns the cross product of this and a given vector v.
| const float ml7::Vector3::dot | ( | const Vector3 & | v | ) | const [inline] |
Returns the dot product of this and a given vector v.
| const float ml7::Vector3::dotsqr | ( | const Vector3 & | v | ) | const [inline] |
Returns the squared dot product of this and a given vector v.
| Vector3& ml7::Vector3::invert | ( | ) | [inline] |
Inverts the sign of the components of this vector.
| const float ml7::Vector3::length | ( | ) | const [inline] |
Returns the magnitude of the vector.
| const float ml7::Vector3::lensqr | ( | ) | const [inline] |
Returns the squared magnitude of the vector.
Scales this vector by a given scalar s and then adds a given vector v to this.
Returns a vector having the maximum components of two given vectors.
Returns a vector having the minimum components of two given vectors.
Scales this vector component-wise by a given vector v.
| Vector3& ml7::Vector3::normalize | ( | ) | [inline] |
Normalizes this vector that it has a magnitude of 1.
| const Vector3 ml7::Vector3::normalized | ( | ) | const [inline] |
Returns a copy of this vector normalized.
| ml7::Vector3::operator const float *const | ( | ) | const [inline] |
| ml7::Vector3::operator float *const | ( | ) | [inline] |
| const bool ml7::Vector3::operator!= | ( | const Vector3 & | v | ) | const [inline] |
Checks if a given vector v and this have non-identical components.
Returns a given vector scaled component-wise by this.
| const Vector3 ml7::Vector3::operator* | ( | const float | s | ) | const [inline] |
Returns a copy of this vector scaled by a given scalar s.
| Vector3& ml7::Vector3::operator*= | ( | const float | s | ) | [inline] |
Scales this vector by a given scalar s.
Scales this vector component-wise by a given vector v.
Returns a given vector v added to this.
Returns a given vector v subtracted from this.
| const Vector3 ml7::Vector3::operator- | ( | ) | const [inline] |
Returns a copy of this vector with the components having signs flipped.
Subtracts a given vector v from this.
| const bool ml7::Vector3::operator< | ( | const Vector3 & | v | ) | const [inline] |
Checks if this vector is component-by-component less than a given vector v.
| const bool ml7::Vector3::operator<= | ( | const Vector3 & | v | ) | const [inline] |
Checks if this vector is component-by-component less than or equal to a given vector v.
Copy assignment operator. Sets x = v.x, ... , z = v.z.
| const bool ml7::Vector3::operator== | ( | const Vector3 & | v | ) | const [inline] |
Checks if a given vector v and this have identical components.
| const bool ml7::Vector3::operator> | ( | const Vector3 & | v | ) | const [inline] |
Checks if this vector is component-by-component greater than a given vector v.
| const bool ml7::Vector3::operator>= | ( | const Vector3 & | v | ) | const [inline] |
Checks if this vector is component-by-component greater than or equal to a given vector v.
| float& ml7::Vector3::operator[] | ( | unsigned | index | ) | [inline] |
Indexed component access.
| const float ml7::Vector3::operator[] | ( | unsigned | index | ) | const [inline] |
Indexed component access.
Returns the vector projection of a given vector v onto this.
| void ml7::Vector3::swap | ( | Vector3 & | v | ) | [inline] |
Swap operation. Swaps the elements of a vector v with this.
| const Vector3 ml7::Vector3::x__ | ( | ) | const [inline] |
Returns a new vector with the x component of this (y = z = 0).
| const Vector3 ml7::Vector3::x_z | ( | ) | const [inline] |
Returns a new vector with the y component of this (x = z = 0).
| const Vector3 ml7::Vector3::xxx | ( | ) | const [inline] |
Returns a new vector with all of its components set to the x value of this.
| const Vector3 ml7::Vector3::xy_ | ( | ) | const [inline] |
Returns a new vector with the x component of this (y = z = 0).
| const Vector3 ml7::Vector3::yyy | ( | ) | const [inline] |
Returns a new vector with all of its components set to the y value of this.
| const Vector3 ml7::Vector3::zzz | ( | ) | const [inline] |
Returns a new vector with all of its components set to the y value of this.
| union { ... } |
| float ml7::Vector3::data[3] |
Array of all three componets.
| float ml7::Vector3::x |
The vector's x value.
const Vector3 ml7::Vector3::X = Vector3( 1, 0, 0 ) [static] |
| float ml7::Vector3::y |
The vector's y value.
const Vector3 ml7::Vector3::Y = Vector3( 0, 1, 0 ) [static] |
| float ml7::Vector3::z |
The vector's z value.
const Vector3 ml7::Vector3::Z = Vector3( 0, 0, 1 ) [static] |
1.7.1