zenilib
0.5.3.0
|
A 2-Space Vector Class. More...
#include <Vector2f.h>
Public Member Functions | |
Vector2f (const bool °enerate_=false) | |
The best way to create a Vector3f. More... | |
Vector2f (const float &i_, const float &j_, const bool °enerate_=false) | |
Vector2f (const Vector2f &rhs, const bool °enerate_=false) | |
Vector2f (const Point2f &rhs) | |
Vector2f (const Vector3f &rhs) | |
float | angle_between (const Vector2f &rhs) const |
Find the angle between the Vector3fs. More... | |
Vector2f | divide_by (const Vector2f &rhs) const |
Divide corresponding members. More... | |
Vector2f | get_i () const |
Get just the i-part. More... | |
Vector2f | get_j () const |
Get just the j-part. More... | |
float | magnitude () const |
Get the magnitude of the vector. More... | |
float | magnitude2 () const |
Get the 'magnitude squared' of the vector. More... | |
Vector2f | multiply_by (const Vector2f &rhs) const |
Multiply corresponding members. More... | |
Vector2f & | normalize () |
Normalize the vector. More... | |
Vector2f | normalized () const |
Get the normalized vector. More... | |
float | operator* (const Vector2f &rhs) const |
Get the dot-product. More... | |
Vector2f | operator* (const float &rhs) const |
Get the scalar multiple. More... | |
Vector2f & | operator*= (const float &rhs) |
Set equal to the scalar multiple. More... | |
Vector2f | operator+ (const Vector2f &rhs) const |
Get the sum. More... | |
Vector2f & | operator+= (const Vector2f &rhs) |
Set equal to the sum. More... | |
Vector2f | operator- (const Vector2f &rhs) const |
Get the difference. More... | |
Vector2f | operator- () const |
Get the negation. More... | |
Vector2f & | operator-= (const Vector2f &rhs) |
Set equal to the difference. More... | |
Vector2f | operator/ (const float &rhs) const |
Get the scalar... something. More... | |
Vector2f & | operator/= (const float &rhs) |
Set equal to the scalar something. More... | |
const float & | operator[] (const int &index) const |
Get 'index'. More... | |
float & | operator[] (const int &index) |
Get 'index'. More... | |
void | set_spherical (const float &theta, const float &magnitude=1) |
Set the vector using spherical coordinates. More... | |
float | theta () const |
theta == radians north of vector i More... | |
Public Attributes | |
union { | |
float i | |
float x | |
}; | |
union { | |
float j | |
float y | |
}; | |
bool | degenerate |
The best way to create a Vector3f.
Definition at line 33 of file Vector2f.hxx.
Referenced by divide_by(), get_i(), get_j(), multiply_by(), normalized(), operator*(), operator+(), operator-(), and operator/().
|
inline |
Definition at line 38 of file Vector2f.hxx.
Definition at line 43 of file Vector2f.hxx.
Definition at line 48 of file Vector2f.hxx.
Definition at line 53 of file Vector2f.hxx.
Find the angle between the Vector3fs.
Definition at line 143 of file Vector2f.hxx.
References magnitude().
Divide corresponding members.
Definition at line 139 of file Vector2f.hxx.
References degenerate, i, j, and Vector2f().
|
inline |
|
inline |
|
inline |
Get the magnitude of the vector.
Definition at line 123 of file Vector2f.hxx.
References magnitude2().
Referenced by angle_between(), normalize(), normalized(), and set_spherical().
|
inline |
Get the 'magnitude squared' of the vector.
Definition at line 119 of file Vector2f.hxx.
Referenced by magnitude().
Multiply corresponding members.
Definition at line 135 of file Vector2f.hxx.
References degenerate, i, j, and Vector2f().
Vector2f & Zeni::Vector2f::normalize | ( | ) |
Normalize the vector.
Definition at line 26 of file Vector2f.cpp.
References degenerate, i, INFINTESSIMAL, j, and magnitude().
Vector2f Zeni::Vector2f::normalized | ( | ) | const |
Get the normalized vector.
Definition at line 44 of file Vector2f.cpp.
References i, INFINTESSIMAL, j, magnitude(), and Vector2f().
Get the scalar multiple.
Definition at line 90 of file Vector2f.hxx.
References degenerate, i, j, and Vector2f().
Get the sum.
Definition at line 58 of file Vector2f.hxx.
References degenerate, i, j, and Vector2f().
Get the difference.
Definition at line 64 of file Vector2f.hxx.
References degenerate, i, j, and Vector2f().
|
inline |
Get the negation.
Definition at line 110 of file Vector2f.hxx.
Set equal to the difference.
Definition at line 77 of file Vector2f.hxx.
References degenerate, i, and j.
Get the scalar... something.
Definition at line 94 of file Vector2f.hxx.
References degenerate, i, j, and Vector2f().
Set equal to the scalar something.
Definition at line 104 of file Vector2f.hxx.
Set the vector using spherical coordinates.
Definition at line 67 of file Vector2f.cpp.
References cos(), degenerate, i, j, magnitude(), and sin().
float Zeni::Vector2f::theta | ( | ) | const |
theta == radians north of vector i
Definition at line 55 of file Vector2f.cpp.
References atan(), i, j, Zeni::Global::pi, Zeni::Global::pi_over_two, and Zeni::Global::three_pi_over_two.
union { ... } |
union { ... } |
bool Zeni::Vector2f::degenerate |
Definition at line 95 of file Vector2f.h.
Referenced by divide_by(), multiply_by(), normalize(), operator*(), operator+(), operator+=(), operator-(), operator-=(), operator/(), and set_spherical().
float Zeni::Vector2f::i |
Definition at line 87 of file Vector2f.h.
Referenced by divide_by(), get_i(), magnitude2(), multiply_by(), normalize(), normalized(), operator*(), operator*=(), operator+(), Zeni::Point2f::operator+(), operator+=(), Zeni::Point2f::operator+=(), operator-(), Zeni::Point2f::operator-(), operator-=(), Zeni::Point2f::operator-=(), operator/(), operator/=(), operator[](), Zeni::serialize(), set_spherical(), theta(), and Zeni::unserialize().
float Zeni::Vector2f::j |
Definition at line 91 of file Vector2f.h.
Referenced by divide_by(), get_j(), magnitude2(), multiply_by(), normalize(), normalized(), operator*(), operator*=(), operator+(), Zeni::Point2f::operator+(), operator+=(), Zeni::Point2f::operator+=(), operator-(), Zeni::Point2f::operator-(), operator-=(), Zeni::Point2f::operator-=(), operator/(), operator/=(), Zeni::serialize(), set_spherical(), theta(), and Zeni::unserialize().
float Zeni::Vector2f::x |
Definition at line 88 of file Vector2f.h.
float Zeni::Vector2f::y |
Definition at line 92 of file Vector2f.h.