FS2_Open
Open source remastering of the Freespace 2 engine
3dmath.cpp File Reference
#include "graphics/2d.h"
#include "hud/hud.h"
#include "render/3dinternal.h"

Go to the source code of this file.

Macros

#define MIN_Z   0.0f
 

Functions

ubyte g3_code_vector (const vec3d *p)
 
ubyte g3_code_vertex (vertex *p)
 
ubyte g3_transfer_vertex (vertex *dest, const vec3d *src)
 
ubyte g3_rotate_vertex (vertex *dest, const vec3d *src)
 
ubyte g3_rotate_faraway_vertex (vertex *dest, const vec3d *src)
 
ubyte g3_rotate_vector (vec3d *dest, const vec3d *src)
 
ubyte g3_project_vector (const vec3d *p, float *sx, float *sy)
 
int g3_project_vertex (vertex *p)
 
void g3_point_to_vec (vec3d *v, int sx, int sy)
 
void g3_point_to_vec_delayed (vec3d *v, int sx, int sy)
 
vec3dg3_rotate_delta_vec (vec3d *dest, const vec3d *src)
 
float g3_calc_point_depth (const vec3d *pnt)
 

Macro Definition Documentation

#define MIN_Z   0.0f

Definition at line 16 of file 3dmath.cpp.

Function Documentation

float g3_calc_point_depth ( const vec3d pnt)

Calculate the depth of a point - returns the z coord of the rotated point

Definition at line 278 of file 3dmath.cpp.

ubyte g3_code_vector ( const vec3d p)

Codes a vector. Returns the codes of a point.

Definition at line 21 of file 3dmath.cpp.

ubyte g3_code_vertex ( vertex p)

Code a point. fills in the p3_codes field of the point, and returns the codes

Definition at line 54 of file 3dmath.cpp.

void g3_point_to_vec ( vec3d v,
int  sx,
int  sy 
)

From a 2d point, compute the vector through that point

Definition at line 231 of file 3dmath.cpp.

void g3_point_to_vec_delayed ( vec3d v,
int  sx,
int  sy 
)

From a 2d point, compute the vector through that point.

This can be called outside of a g3_start_frame/g3_end_frame pair as long g3_start_frame was previously called.

Definition at line 254 of file 3dmath.cpp.

ubyte g3_project_vector ( const vec3d p,
float sx,
float sy 
)

Projects a vector

Definition at line 184 of file 3dmath.cpp.

int g3_project_vertex ( vertex p)

Projects a point. Checks for overflow.

Definition at line 202 of file 3dmath.cpp.

vec3d* g3_rotate_delta_vec ( vec3d dest,
const vec3d src 
)

Definition at line 269 of file 3dmath.cpp.

ubyte g3_rotate_faraway_vertex ( vertex dest,
const vec3d src 
)

Use this for stars, etc

Definition at line 156 of file 3dmath.cpp.

ubyte g3_rotate_vector ( vec3d dest,
const vec3d src 
)

Rotates a point. returns codes. does not check if already rotated

Definition at line 171 of file 3dmath.cpp.

ubyte g3_rotate_vertex ( vertex dest,
const vec3d src 
)

Rotates a point. returns codes. does not check if already rotated

Definition at line 97 of file 3dmath.cpp.

ubyte g3_transfer_vertex ( vertex dest,
const vec3d src 
)

Definition at line 84 of file 3dmath.cpp.