FS2_Open
Open source remastering of the Freespace 2 engine
vecmat.h File Reference
#include "globalincs/pstypes.h"
#include "math/floating.h"

Go to the source code of this file.

Classes

struct  plane
 

Macros

#define vm_is_vec_nan(v)   (_isnan((v)->xyz.x) || _isnan((v)->xyz.y) || _isnan((v)->xyz.z))
 
#define IS_VEC_NULL_SQ_SAFE(v)
 
#define IS_VEC_NULL(v)
 
#define IS_MAT_NULL(v)   (IS_VEC_NULL(&(v)->vec.fvec) && IS_VEC_NULL(&(v)->vec.uvec) && IS_VEC_NULL(&(v)->vec.rvec))
 
#define vm_vec_zero(v)   (v)->xyz.x=(v)->xyz.y=(v)->xyz.z=0.0f
 
#define vm_vec_make(v, _x, _y, _z)   ((v)->xyz.x=(_x), (v)->xyz.y=(_y), (v)->xyz.z=(_z))
 
#define ZERO_VECTOR   { { { 0.0f, 0.0f, 0.0f } } }
 
#define IDENTITY_MATRIX   { { { { { { 1.0f, 0.0f, 0.0f } } }, { { { 0.0f, 1.0f, 0.0f } } }, { { { 0.0f, 0.0f, 1.0f } } } } } }
 
#define vm_angvec_make(v, _p, _b, _h)   (((v)->p=(_p), (v)->b=(_b), (v)->h=(_h)), (v))
 
#define vm_vec_negate(v)   do {(v)->xyz.x = - (v)->xyz.x; (v)->xyz.y = - (v)->xyz.y; (v)->xyz.z = - (v)->xyz.z;} while (0);
 

Typedefs

typedef struct plane plane
 

Functions

void vm_set_identity (matrix *m)
 
void vm_vec_add (vec3d *dest, const vec3d *src0, const vec3d *src1)
 
void vm_vec_add2 (vec3d *dest, const vec3d *src)
 
void vm_vec_scale_sub2 (vec3d *dest, const vec3d *src, float k)
 
void vm_vec_sub (vec3d *dest, const vec3d *src0, const vec3d *src1)
 
void vm_vec_sub2 (vec3d *dest, const vec3d *src)
 
vec3dvm_vec_avg_n (vec3d *dest, int n, const vec3d src[])
 
vec3dvm_vec_avg (vec3d *dest, const vec3d *src0, const vec3d *src1)
 
vec3dvm_vec_avg3 (vec3d *dest, const vec3d *src0, const vec3d *src1, const vec3d *src2)
 
vec3dvm_vec_avg4 (vec3d *dest, const vec3d *src0, const vec3d *src1, const vec3d *src2, const vec3d *src3)
 
void vm_vec_scale (vec3d *dest, float s)
 
void vm_vec_copy_scale (vec3d *dest, const vec3d *src, float s)
 
void vm_vec_scale_add (vec3d *dest, const vec3d *src1, const vec3d *src2, float k)
 
void vm_vec_scale_sub (vec3d *dest, const vec3d *src1, const vec3d *src2, float k)
 
void vm_vec_scale_add2 (vec3d *dest, const vec3d *src, float k)
 
void vm_vec_scale2 (vec3d *dest, float n, float d)
 
bool vm_vec_equal (const vec2d &self, const vec2d &other)
 
bool vm_vec_equal (const vec3d &self, const vec3d &other)
 
bool vm_vec_equal (const vec4 &self, const vec4 &other)
 
bool vm_matrix_equal (const matrix &self, const matrix &other)
 
bool vm_matrix_equal (const matrix4 &self, const matrix4 &other)
 
float vm_vec_projection_parallel (vec3d *component, const vec3d *src, const vec3d *unit_vector)
 
void vm_vec_projection_onto_plane (vec3d *projection, const vec3d *src, const vec3d *normal)
 
float vm_vec_mag (const vec3d *v)
 
float vm_vec_mag_squared (const vec3d *v)
 
float vm_vec_dist_squared (const vec3d *v0, const vec3d *v1)
 
float vm_vec_dist (const vec3d *v0, const vec3d *v1)
 
float vm_vec_mag_quick (const vec3d *v)
 
float vm_vec_dist_quick (const vec3d *v0, const vec3d *v1)
 
float vm_vec_copy_normalize (vec3d *dest, const vec3d *src)
 
float vm_vec_normalize (vec3d *v)
 
float vm_vec_normalize_safe (vec3d *v)
 
float vm_vec_copy_normalize_quick (vec3d *dest, const vec3d *src)
 
float vm_vec_normalize_quick (vec3d *v)
 
float vm_vec_copy_normalize_quick_mag (vec3d *dest, const vec3d *src)
 
float vm_vec_normalize_quick_mag (vec3d *v)
 
float vm_vec_normalized_dir (vec3d *dest, const vec3d *end, const vec3d *start)
 
float vm_vec_normalized_dir_quick_mag (vec3d *dest, const vec3d *end, const vec3d *start)
 
float vm_vec_normalized_dir_quick (vec3d *dest, const vec3d *end, const vec3d *start)
 
float vm_vec_dot (const vec3d *v0, const vec3d *v1)
 
float vm_vec_dot3 (float x, float y, float z, vec3d *v)
 
vec3dvm_vec_cross (vec3d *dest, const vec3d *src0, const vec3d *src1)
 
int vm_test_parallel (const vec3d *src0, const vec3d *src1)
 
vec3dvm_vec_normal (vec3d *dest, const vec3d *p0, const vec3d *p1, const vec3d *p2)
 
vec3dvm_vec_perp (vec3d *dest, const vec3d *p0, const vec3d *p1, const vec3d *p2)
 
float vm_vec_delta_ang (const vec3d *v0, const vec3d *v1, const vec3d *fvec)
 
float vm_vec_delta_ang_norm (const vec3d *v0, const vec3d *v1, const vec3d *fvec)
 
matrixvm_angles_2_matrix (matrix *m, const angles *a)
 
matrixvm_angle_2_matrix (matrix *m, float a, int angle_index)
 
matrixvm_vec_ang_2_matrix (matrix *m, const vec3d *v, float a)
 
matrixvm_vector_2_matrix (matrix *m, const vec3d *fvec, const vec3d *uvec, const vec3d *rvec)
 
matrixvm_vector_2_matrix_norm (matrix *m, const vec3d *fvec, const vec3d *uvec=NULL, const vec3d *rvec=NULL)
 
vec3dvm_vec_rotate (vec3d *dest, const vec3d *src, const matrix *m)
 
vec3dvm_vec_unrotate (vec3d *dest, const vec3d *src, const matrix *m)
 
matrixvm_transpose (matrix *m)
 
matrixvm_copy_transpose (matrix *dest, const matrix *src)
 
matrixvm_matrix_x_matrix (matrix *dest, const matrix *src0, const matrix *src1)
 
anglesvm_extract_angles_matrix (angles *a, const matrix *m)
 
anglesvm_extract_angles_matrix_alternate (angles *a, const matrix *m)
 
anglesvm_extract_angles_vector (angles *a, const vec3d *v)
 
void vm_orthogonalize_matrix (matrix *m_src)
 
void vm_fix_matrix (matrix *m)
 
void vm_rotate_matrix_by_angles (matrix *orient, const angles *tangles)
 
float vm_dist_to_plane (const vec3d *checkp, const vec3d *norm, const vec3d *planep)
 
void vm_trackball (int idx, int idy, matrix *RotMat)
 
float find_nearest_point_on_line (vec3d *nearest_point, const vec3d *p0, const vec3d *p1, const vec3d *int_pnt)
 
float vm_vec_dot_to_point (const vec3d *dir, const vec3d *p1, const vec3d *p2)
 
void compute_point_on_plane (vec3d *q, const plane *planep, const vec3d *p)
 
void vm_project_point_onto_plane (vec3d *new_point, const vec3d *point, const vec3d *plane_normal, const vec3d *plane_point)
 
void vm_vec_rand_vec_quick (vec3d *rvec)
 
void vm_rot_point_around_line (vec3d *out, const vec3d *in, float angle, const vec3d *line_point, const vec3d *line_dir)
 
int vm_vec_cmp (const vec3d *a, const vec3d *b)
 
int vm_matrix_cmp (const matrix *a, const matrix *b)
 
float vm_interp_angle (float *h, float desired_angle, float step_size, bool force_front=false)
 
float vm_delta_from_interp_angle (float current_angle, float desired_angle)
 
int vm_check_matrix_for_zeros (const matrix *m)
 
int vm_vec_same (const vec3d *v1, const vec3d *v2)
 
int vm_matrix_same (matrix *m1, matrix *m2)
 
void vm_matrix_interpolate (const matrix *goal_orient, const matrix *start_orient, const vec3d *rotvel_in, float delta_t, matrix *next_orient, vec3d *rotvel_out, const vec3d *rotvel_limit, const vec3d *acc_limit, int no_overshoot=0)
 
void vm_forward_interpolate (const vec3d *goal_fvec, const matrix *orient, const vec3d *rotvel_in, float delta_t, float delta_bank, matrix *next_orient, vec3d *rotvel_out, const vec3d *vel_limit, const vec3d *acc_limit, int no_overshoot=0)
 
void vm_find_bounding_sphere (const vec3d *pnts, int num_pnts, vec3d *center, float *radius)
 
float atan2_safe (float x, float y)
 
vec3dvm_rotate_vec_to_body (vec3d *body_vec, const vec3d *world_vec, const matrix *orient)
 
vec3dvm_rotate_vec_to_world (vec3d *world_vec, const vec3d *body_vec, const matrix *orient)
 
void vm_estimate_next_orientation (const matrix *last_orient, const matrix *current_orient, matrix *next_orient)
 
int is_valid_vec (const vec3d *vec)
 
int is_valid_matrix (const matrix *m)
 
void vm_quaternion_rotate (matrix *m, float theta, const vec3d *u)
 
void vm_matrix_to_rot_axis_and_angle (const matrix *m, float *theta, vec3d *rot_axis)
 
void vm_vec_interp_constant (vec3d *out, const vec3d *v1, const vec3d *v2, float t)
 
void vm_vec_random_cone (vec3d *out, const vec3d *in, float max_angle, const matrix *orient=NULL)
 
void vm_vec_random_cone (vec3d *out, const vec3d *in, float min_angle, float max_angle, const matrix *orient=NULL)
 
void vm_vec_random_in_circle (vec3d *out, const vec3d *in, const matrix *orient, float radius, int on_edge)
 
void vm_vec_random_in_sphere (vec3d *out, const vec3d *in, const matrix *orient, float radius, int on_edge)
 
int vm_vec_dist_to_line (const vec3d *p, const vec3d *l0, const vec3d *l1, vec3d *nearest, float *dist)
 
void vm_vec_dist_squared_to_line (const vec3d *p, const vec3d *l0, const vec3d *l1, vec3d *nearest, float *dist_squared)
 
void vm_vec_boxscale (vec2d *vec, float scale)
 
bool vm_inverse_matrix4 (const matrix4 *m, matrix4 *invOut)
 Attempts to invert a 4x4 matrix. More...
 

Variables

vec3d vmd_zero_vector
 
vec3d vmd_x_vector
 
vec3d vmd_y_vector
 
vec3d vmd_z_vector
 
matrix vmd_identity_matrix
 

Macro Definition Documentation

#define IDENTITY_MATRIX   { { { { { { 1.0f, 0.0f, 0.0f } } }, { { { 0.0f, 1.0f, 0.0f } } }, { { { 0.0f, 0.0f, 1.0f } } } } } }

Definition at line 64 of file vecmat.h.

#define IS_MAT_NULL (   v)    (IS_VEC_NULL(&(v)->vec.fvec) && IS_VEC_NULL(&(v)->vec.uvec) && IS_VEC_NULL(&(v)->vec.rvec))

Definition at line 32 of file vecmat.h.

#define IS_VEC_NULL (   v)
Value:
( ( (v)->xyz.x > -1e-36 ) && ( (v)->xyz.x < 1e-36 ) && \
( (v)->xyz.y > -1e-36 ) && ( (v)->xyz.y < 1e-36 ) && \
( (v)->xyz.z > -1e-36 ) && ( (v)->xyz.z < 1e-36 ) )
const GLdouble * v
Definition: Glext.h:5322

Definition at line 28 of file vecmat.h.

#define IS_VEC_NULL_SQ_SAFE (   v)
Value:
( ( (v)->xyz.x > -1e-16 ) && ( (v)->xyz.x < 1e-16 ) && \
( (v)->xyz.y > -1e-16 ) && ( (v)->xyz.y < 1e-16 ) && \
( (v)->xyz.z > -1e-16 ) && ( (v)->xyz.z < 1e-16 ) )
const GLdouble * v
Definition: Glext.h:5322

Definition at line 24 of file vecmat.h.

#define vm_angvec_make (   v,
  _p,
  _b,
  _h 
)    (((v)->p=(_p), (v)->b=(_b), (v)->h=(_h)), (v))

Definition at line 67 of file vecmat.h.

#define vm_is_vec_nan (   v)    (_isnan((v)->xyz.x) || _isnan((v)->xyz.y) || _isnan((v)->xyz.z))

Definition at line 19 of file vecmat.h.

#define vm_vec_make (   v,
  _x,
  _y,
  _z 
)    ((v)->xyz.x=(_x), (v)->xyz.y=(_y), (v)->xyz.z=(_z))

Definition at line 48 of file vecmat.h.

#define vm_vec_negate (   v)    do {(v)->xyz.x = - (v)->xyz.x; (v)->xyz.y = - (v)->xyz.y; (v)->xyz.z = - (v)->xyz.z;} while (0);

Definition at line 70 of file vecmat.h.

#define vm_vec_zero (   v)    (v)->xyz.x=(v)->xyz.y=(v)->xyz.z=0.0f

Definition at line 37 of file vecmat.h.

#define ZERO_VECTOR   { { { 0.0f, 0.0f, 0.0f } } }

Definition at line 60 of file vecmat.h.

Typedef Documentation

typedef struct plane plane

Function Documentation

float atan2_safe ( float  x,
float  y 
)

Definition at line 68 of file vecmat.cpp.

void compute_point_on_plane ( vec3d q,
const plane planep,
const vec3d p 
)

Definition at line 1363 of file vecmat.cpp.

float find_nearest_point_on_line ( vec3d nearest_point,
const vec3d p0,
const vec3d p1,
const vec3d int_pnt 
)

Definition at line 1209 of file vecmat.cpp.

int is_valid_matrix ( const matrix m)

Definition at line 2395 of file vecmat.cpp.

int is_valid_vec ( const vec3d vec)

Definition at line 2389 of file vecmat.cpp.

matrix* vm_angle_2_matrix ( matrix m,
float  a,
int  angle_index 
)

Definition at line 768 of file vecmat.cpp.

matrix* vm_angles_2_matrix ( matrix m,
const angles a 
)

Definition at line 752 of file vecmat.cpp.

int vm_check_matrix_for_zeros ( const matrix m)

Definition at line 1506 of file vecmat.cpp.

matrix* vm_copy_transpose ( matrix dest,
const matrix src 
)

Definition at line 984 of file vecmat.cpp.

float vm_delta_from_interp_angle ( float  current_angle,
float  desired_angle 
)

Definition at line 1487 of file vecmat.cpp.

float vm_dist_to_plane ( const vec3d checkp,
const vec3d norm,
const vec3d planep 
)

Definition at line 1128 of file vecmat.cpp.

void vm_estimate_next_orientation ( const matrix last_orient,
const matrix current_orient,
matrix next_orient 
)

Definition at line 2376 of file vecmat.cpp.

angles* vm_extract_angles_matrix ( angles a,
const matrix m 
)

Definition at line 1027 of file vecmat.cpp.

angles* vm_extract_angles_matrix_alternate ( angles a,
const matrix m 
)

Definition at line 1064 of file vecmat.cpp.

angles* vm_extract_angles_vector ( angles a,
const vec3d v 
)

Definition at line 1114 of file vecmat.cpp.

void vm_find_bounding_sphere ( const vec3d pnts,
int  num_pnts,
vec3d center,
float radius 
)

Definition at line 2249 of file vecmat.cpp.

void vm_fix_matrix ( matrix m)

Definition at line 1286 of file vecmat.cpp.

void vm_forward_interpolate ( const vec3d goal_fvec,
const matrix orient,
const vec3d rotvel_in,
float  delta_t,
float  delta_bank,
matrix next_orient,
vec3d rotvel_out,
const vec3d vel_limit,
const vec3d acc_limit,
int  no_overshoot = 0 
)

Definition at line 2061 of file vecmat.cpp.

float vm_interp_angle ( float h,
float  desired_angle,
float  step_size,
bool  force_front = false 
)

Definition at line 1444 of file vecmat.cpp.

bool vm_inverse_matrix4 ( const matrix4 m,
matrix4 invOut 
)

Attempts to invert a 4x4 matrix.

Parameters
[in]mPointer to the matrix we want to invert
[in,out]invOutThe inverted matrix, or nullptr if inversion is impossible
Returns
Whether or not the matrix is invertible

Definition at line 2587 of file vecmat.cpp.

int vm_matrix_cmp ( const matrix a,
const matrix b 
)

Definition at line 1426 of file vecmat.cpp.

bool vm_matrix_equal ( const matrix self,
const matrix other 
)

Definition at line 49 of file vecmat.cpp.

bool vm_matrix_equal ( const matrix4 self,
const matrix4 other 
)

Definition at line 54 of file vecmat.cpp.

void vm_matrix_interpolate ( const matrix goal_orient,
const matrix start_orient,
const vec3d rotvel_in,
float  delta_t,
matrix next_orient,
vec3d rotvel_out,
const vec3d rotvel_limit,
const vec3d acc_limit,
int  no_overshoot = 0 
)

Definition at line 1859 of file vecmat.cpp.

int vm_matrix_same ( matrix m1,
matrix m2 
)

Definition at line 1535 of file vecmat.cpp.

void vm_matrix_to_rot_axis_and_angle ( const matrix m,
float theta,
vec3d rot_axis 
)

Definition at line 1612 of file vecmat.cpp.

matrix* vm_matrix_x_matrix ( matrix dest,
const matrix src0,
const matrix src1 
)

Definition at line 1006 of file vecmat.cpp.

void vm_orthogonalize_matrix ( matrix m_src)

Definition at line 1247 of file vecmat.cpp.

void vm_project_point_onto_plane ( vec3d new_point,
const vec3d point,
const vec3d plane_normal,
const vec3d plane_point 
)

Definition at line 128 of file vecmat.cpp.

void vm_quaternion_rotate ( matrix m,
float  theta,
const vec3d u 
)

Definition at line 1548 of file vecmat.cpp.

void vm_rot_point_around_line ( vec3d out,
const vec3d in,
float  angle,
const vec3d line_point,
const vec3d line_dir 
)

Definition at line 1395 of file vecmat.cpp.

void vm_rotate_matrix_by_angles ( matrix orient,
const angles tangles 
)

Definition at line 1338 of file vecmat.cpp.

vec3d* vm_rotate_vec_to_body ( vec3d body_vec,
const vec3d world_vec,
const matrix orient 
)

Definition at line 2346 of file vecmat.cpp.

vec3d* vm_rotate_vec_to_world ( vec3d world_vec,
const vec3d body_vec,
const matrix orient 
)

Definition at line 2361 of file vecmat.cpp.

void vm_set_identity ( matrix m)

Definition at line 150 of file vecmat.cpp.

int vm_test_parallel ( const vec3d src0,
const vec3d src1 
)

Definition at line 655 of file vecmat.cpp.

void vm_trackball ( int  idx,
int  idy,
matrix RotMat 
)

Definition at line 1151 of file vecmat.cpp.

matrix* vm_transpose ( matrix m)

Definition at line 971 of file vecmat.cpp.

void vm_vec_add ( vec3d dest,
const vec3d src0,
const vec3d src1 
)

Definition at line 159 of file vecmat.cpp.

void vm_vec_add2 ( vec3d dest,
const vec3d src 
)

Definition at line 178 of file vecmat.cpp.

matrix* vm_vec_ang_2_matrix ( matrix m,
const vec3d v,
float  a 
)

Definition at line 801 of file vecmat.cpp.

vec3d* vm_vec_avg ( vec3d dest,
const vec3d src0,
const vec3d src1 
)

Definition at line 217 of file vecmat.cpp.

vec3d* vm_vec_avg3 ( vec3d dest,
const vec3d src0,
const vec3d src1,
const vec3d src2 
)

Definition at line 228 of file vecmat.cpp.

vec3d* vm_vec_avg4 ( vec3d dest,
const vec3d src0,
const vec3d src1,
const vec3d src2,
const vec3d src3 
)

Definition at line 238 of file vecmat.cpp.

vec3d* vm_vec_avg_n ( vec3d dest,
int  n,
const vec3d  src[] 
)

Definition at line 196 of file vecmat.cpp.

void vm_vec_boxscale ( vec2d vec,
float  scale 
)

Definition at line 2572 of file vecmat.cpp.

int vm_vec_cmp ( const vec3d a,
const vec3d b 
)

Definition at line 1415 of file vecmat.cpp.

float vm_vec_copy_normalize ( vec3d dest,
const vec3d src 
)

Definition at line 427 of file vecmat.cpp.

float vm_vec_copy_normalize_quick ( vec3d dest,
const vec3d src 
)

Definition at line 512 of file vecmat.cpp.

float vm_vec_copy_normalize_quick_mag ( vec3d dest,
const vec3d src 
)

Definition at line 548 of file vecmat.cpp.

void vm_vec_copy_scale ( vec3d dest,
const vec3d src,
float  s 
)

Definition at line 257 of file vecmat.cpp.

vec3d* vm_vec_cross ( vec3d dest,
const vec3d src0,
const vec3d src1 
)

Definition at line 645 of file vecmat.cpp.

float vm_vec_delta_ang ( const vec3d v0,
const vec3d v1,
const vec3d fvec 
)

Definition at line 687 of file vecmat.cpp.

float vm_vec_delta_ang_norm ( const vec3d v0,
const vec3d v1,
const vec3d fvec 
)

Definition at line 706 of file vecmat.cpp.

float vm_vec_dist ( const vec3d v0,
const vec3d v1 
)

Definition at line 355 of file vecmat.cpp.

float vm_vec_dist_quick ( const vec3d v0,
const vec3d v1 
)

Definition at line 417 of file vecmat.cpp.

float vm_vec_dist_squared ( const vec3d v0,
const vec3d v1 
)

Definition at line 344 of file vecmat.cpp.

void vm_vec_dist_squared_to_line ( const vec3d p,
const vec3d l0,
const vec3d l1,
vec3d nearest,
float dist_squared 
)

Definition at line 2543 of file vecmat.cpp.

int vm_vec_dist_to_line ( const vec3d p,
const vec3d l0,
const vec3d l1,
vec3d nearest,
float dist 
)

Definition at line 2503 of file vecmat.cpp.

float vm_vec_dot ( const vec3d v0,
const vec3d v1 
)

Definition at line 312 of file vecmat.cpp.

float vm_vec_dot3 ( float  x,
float  y,
float  z,
vec3d v 
)
float vm_vec_dot_to_point ( const vec3d dir,
const vec3d p1,
const vec3d p2 
)

Definition at line 1348 of file vecmat.cpp.

bool vm_vec_equal ( const vec2d self,
const vec2d other 
)

Definition at line 44 of file vecmat.cpp.

bool vm_vec_equal ( const vec3d self,
const vec3d other 
)

Definition at line 39 of file vecmat.cpp.

bool vm_vec_equal ( const vec4 self,
const vec4 other 
)

Definition at line 34 of file vecmat.cpp.

void vm_vec_interp_constant ( vec3d out,
const vec3d v1,
const vec3d v2,
float  t 
)

Definition at line 2401 of file vecmat.cpp.

float vm_vec_mag ( const vec3d v)

Definition at line 325 of file vecmat.cpp.

float vm_vec_mag_quick ( const vec3d v)

Definition at line 371 of file vecmat.cpp.

float vm_vec_mag_squared ( const vec3d v)

Definition at line 339 of file vecmat.cpp.

vec3d* vm_vec_normal ( vec3d dest,
const vec3d p0,
const vec3d p1,
const vec3d p2 
)

Definition at line 626 of file vecmat.cpp.

float vm_vec_normalize ( vec3d v)

Definition at line 460 of file vecmat.cpp.

float vm_vec_normalize_quick ( vec3d v)

Definition at line 529 of file vecmat.cpp.

float vm_vec_normalize_quick_mag ( vec3d v)

Definition at line 569 of file vecmat.cpp.

float vm_vec_normalize_safe ( vec3d v)

Definition at line 471 of file vecmat.cpp.

float vm_vec_normalized_dir ( vec3d dest,
const vec3d end,
const vec3d start 
)

Definition at line 591 of file vecmat.cpp.

float vm_vec_normalized_dir_quick ( vec3d dest,
const vec3d end,
const vec3d start 
)

Definition at line 604 of file vecmat.cpp.

float vm_vec_normalized_dir_quick_mag ( vec3d dest,
const vec3d end,
const vec3d start 
)

Definition at line 614 of file vecmat.cpp.

vec3d* vm_vec_perp ( vec3d dest,
const vec3d p0,
const vec3d p1,
const vec3d p2 
)

Definition at line 667 of file vecmat.cpp.

void vm_vec_projection_onto_plane ( vec3d projection,
const vec3d src,
const vec3d normal 
)

Definition at line 112 of file vecmat.cpp.

float vm_vec_projection_parallel ( vec3d component,
const vec3d src,
const vec3d unit_vector 
)

Definition at line 97 of file vecmat.cpp.

void vm_vec_rand_vec_quick ( vec3d rvec)

Definition at line 1379 of file vecmat.cpp.

void vm_vec_random_cone ( vec3d out,
const vec3d in,
float  max_angle,
const matrix orient = NULL 
)

Definition at line 2418 of file vecmat.cpp.

void vm_vec_random_cone ( vec3d out,
const vec3d in,
float  min_angle,
float  max_angle,
const matrix orient = NULL 
)

Definition at line 2442 of file vecmat.cpp.

void vm_vec_random_in_circle ( vec3d out,
const vec3d in,
const matrix orient,
float  radius,
int  on_edge 
)

Definition at line 2481 of file vecmat.cpp.

void vm_vec_random_in_sphere ( vec3d out,
const vec3d in,
const matrix orient,
float  radius,
int  on_edge 
)

Definition at line 2494 of file vecmat.cpp.

vec3d* vm_vec_rotate ( vec3d dest,
const vec3d src,
const matrix m 
)

Definition at line 933 of file vecmat.cpp.

int vm_vec_same ( const vec3d v1,
const vec3d v2 
)

Definition at line 1526 of file vecmat.cpp.

void vm_vec_scale ( vec3d dest,
float  s 
)

Definition at line 248 of file vecmat.cpp.

void vm_vec_scale2 ( vec3d dest,
float  n,
float  d 
)

Definition at line 302 of file vecmat.cpp.

void vm_vec_scale_add ( vec3d dest,
const vec3d src1,
const vec3d src2,
float  k 
)

Definition at line 266 of file vecmat.cpp.

void vm_vec_scale_add2 ( vec3d dest,
const vec3d src,
float  k 
)

Definition at line 284 of file vecmat.cpp.

void vm_vec_scale_sub ( vec3d dest,
const vec3d src1,
const vec3d src2,
float  k 
)

Definition at line 275 of file vecmat.cpp.

void vm_vec_scale_sub2 ( vec3d dest,
const vec3d src,
float  k 
)

Definition at line 293 of file vecmat.cpp.

void vm_vec_sub ( vec3d dest,
const vec3d src0,
const vec3d src1 
)

Definition at line 168 of file vecmat.cpp.

void vm_vec_sub2 ( vec3d dest,
const vec3d src 
)

Definition at line 187 of file vecmat.cpp.

vec3d* vm_vec_unrotate ( vec3d dest,
const vec3d src,
const matrix m 
)

Definition at line 959 of file vecmat.cpp.

matrix* vm_vector_2_matrix ( matrix m,
const vec3d fvec,
const vec3d uvec,
const vec3d rvec 
)

Definition at line 850 of file vecmat.cpp.

matrix* vm_vector_2_matrix_norm ( matrix m,
const vec3d fvec,
const vec3d uvec = NULL,
const vec3d rvec = NULL 
)

Definition at line 891 of file vecmat.cpp.

Variable Documentation

matrix vmd_identity_matrix

Definition at line 28 of file vecmat.cpp.

vec3d vmd_x_vector

Definition at line 25 of file vecmat.cpp.

vec3d vmd_y_vector

Definition at line 26 of file vecmat.cpp.

vec3d vmd_z_vector

Definition at line 27 of file vecmat.cpp.

vec3d vmd_zero_vector

Definition at line 24 of file vecmat.cpp.