#include <vector.h>
Public Methods | |
| vec3_c () | |
| standard constructor | |
| vec3_c (const vec3_c &) | |
| copy constructor | |
| vec3_c (const vec3_t) | |
| vector from vec3_t | |
| vec3_c (float, float, float) | |
| vector from floats | |
| virtual | ~vec3_c () |
| destructor | |
| operator const float * () | |
| floats from vector | |
| void | set (float x, float y, float z) |
| set vector coordinates | |
| void | set_component (int n, float x) |
| set component n to value x. | |
| void | clear () |
| set to (0,0,0) | |
| float | length () |
| determine the length of a vector | |
| float | length_squared () |
| determine the length of a vector | |
| vec3_c | operator- (const vec3_t) |
| subtract vectors | |
| vec3_c | operator * (const vec3_t) |
| scale by vector | |
| vec3_c | operator= (const vec3_t) |
| assignment | |
| bool | operator== (const vec3_t) |
| comparison | |
| vec3_c | cross (const vec3_t v) |
| create cross product | |
| float | dot (const vec3_t v) |
| create dot product | |
| vec3_c | rotate (const vec3_t angles) |
| rotate a vector | |
| vec3_c | project_on_plane (const vec3_t normal) |
| vec3_c | perpendicular () |
| vec3_c | rotate_vec (const float degrees, const vec3_t dir) |
| void | get_view_from_angles (vec3_c &forward, vec3_c &right, vec3_c &up) |
| ushort | pack_normal () |
| pack a normal | |
Static Public Methods | |
| vec3_c | unpack_normal (ushort in) |
| unpack a normal | |
| vec3_c | bezier_patch (const patch_t patch, float u, float v) |
| get a point on a patch | |
| vec3_c | bezier_spline (const spline_t spline, const float frac) |
| vec3_c | hermite (const vec3_t p1, const vec3_t t1, const vec3_t p2, const vec3_t t2, const float frac) |
| vec3_c | linear (const vec3_t p1, const vec3_t p2, const float frac) |
Protected Attributes | |
| vec3_t | vec |
| the data | |
|
||||||||||||
|
bezier interpolation Interpolates between two vectors using bezier spline interpolation.
Definition at line 311 of file m_vector.cpp. References spline_t. |
|
||||||||||||||||
|
convert angles to vectors Converts angles (yaw, pitch, roll) to view vectors (forward, right, up)
Definition at line 166 of file m_vector.cpp. References ANGLE_PITCH, ANGLE_ROLL, ANGLE_YAW, and DEG2RAD. Referenced by particle_emitter_c::update(). |
|
||||||||||||||||||||||||
|
hermite interpolation Interpolates between two vectors using hermite interpolation.
Definition at line 631 of file m_vector.cpp. References set_component(), and vec3_t. Referenced by path_c::get_pos(). |
|
|
Returns the distance of this vector from the origin / its magnitude. Definition at line 398 of file m_vector.cpp. |
|
|
Returns the squared distance of this vector from the origin. Definition at line 406 of file m_vector.cpp. References vec, VECT_X, VECT_Y, and VECT_Z. Referenced by unpack_normal(). |
|
||||||||||||||||
|
linear interpolation Interpolates between two vectors using linear interpolation.
Definition at line 611 of file m_vector.cpp. References _interpolate_float_linear(), set_component(), and vec3_t. Referenced by md2_c::set_frame(), and kmf_c::set_frame(). |
|
|
Uses this vector as a normal and packs it into a ushort. Definition at line 198 of file m_vector.cpp. References vec. |
|
|
get a perpendicular vector Gets a vector that is perpendicular to the input vector. Definition at line 84 of file m_vector.cpp. References normalize(), project_on_plane(), and vec3_t. Referenced by rotate_vec(). |
|
|
project vector on a plane Project a vector onto a plane
Definition at line 61 of file m_vector.cpp. References vec3_t. Referenced by perpendicular(). |
|
|
Definition at line 570 of file m_vector.cpp. References ANGLE_PITCH, ANGLE_ROLL, ANGLE_YAW, DEG2RAD, and vec3_t. |
|
||||||||||||
|
rotate a point around vector Rotates a point around a given axis.
Definition at line 117 of file m_vector.cpp. References cross(), DEG2RAD, matrix3_mult(), matrix3_t, perpendicular(), and vec3_t. Referenced by particle_type_c::draw(), and particle_emitter_c::update(). |
|
|
Unpacks a packed normal from a ushort and returns it.
Definition at line 210 of file m_vector.cpp. References length_squared(), normalize(), set(), set_component(), and vec. Referenced by kmf_c::set_frame(). |
1.2.18