FS2_Open
Open source remastering of the Freespace 2 engine
|
#include "graphics/2d.h"
#include "graphics/tmapper.h"
#include "lighting/lighting.h"
#include "render/3dinternal.h"
Go to the source code of this file.
Classes | |
struct | instance_context |
Macros | |
#define | MAX_INSTANCE_DEPTH 10 |
Functions | |
int | g3_in_frame () |
void | g3_start_frame_func (int zbuffer_flag, const char *filename, int lineno) |
void | g3_end_frame_func (const char *filename, int lineno) |
void | scale_matrix (void) |
void | g3_set_view (camera *cam) |
void | g3_set_view_matrix (const vec3d *view_pos, const matrix *view_matrix, float zoom) |
void | g3_set_view_angles (const vec3d *view_pos, const angles *view_orient, float zoom) |
ubyte | g3_rotate_vertex_popped (vertex *dest, const vec3d *src) |
void | g3_start_instance_matrix (const vec3d *pos, const matrix *orient, bool set_api) |
void | g3_start_instance_angles (const vec3d *pos, const angles *orient) |
void | g3_done_instance (bool use_api) |
void | g3_start_user_clip_plane (const vec3d *plane_point, const vec3d *plane_normal) |
void | g3_stop_user_clip_plane () |
int | g3_point_behind_user_plane (const vec3d *pnt) |
#define MAX_INSTANCE_DEPTH 10 |
Definition at line 46 of file 3dsetup.cpp.
void g3_done_instance | ( | bool | use_api | ) |
Pops the old context
Definition at line 341 of file 3dsetup.cpp.
This doesn't do anything, but is here for completeness
Definition at line 126 of file 3dsetup.cpp.
int g3_in_frame | ( | ) |
Check if in frame
Definition at line 66 of file 3dsetup.cpp.
Returns TRUE if point is behind user plane
Definition at line 419 of file 3dsetup.cpp.
Same as above, only ignores the current instancing
Definition at line 228 of file 3dsetup.cpp.
Set view from camera
Definition at line 137 of file 3dsetup.cpp.
Set view from x,y,z & p,b,h, zoom. Must call one of g3_set_view_*()
Definition at line 182 of file 3dsetup.cpp.
Set view from x,y,z, viewer matrix, and zoom. Must call one of g3_set_view_*()
Definition at line 152 of file 3dsetup.cpp.
Start the frame Pass true for zbuffer_flag to turn on zbuffering
Definition at line 75 of file 3dsetup.cpp.
Instance at specified point with specified orientation
If angles==NULL, don't modify matrix. This will be like doing an offset
Definition at line 317 of file 3dsetup.cpp.
nstance at specified point with specified orientation
if matrix==NULL, don't modify matrix. This will be like doing an offset if pos==NULL, no position change
Definition at line 249 of file 3dsetup.cpp.
Enables clipping with an arbritary plane.
This will be on until g3_stop_clip_plane is called or until next frame. The points passed should be relative to the instance. Probably that means world coordinates.
This works like any other clip plane... if this is enabled and you rotate a point, the CC_OFF_USER bit will be set in the clipping codes. It is completely handled by most g3_draw primitives, except maybe lines.
As far as performance, when enabled, it will slow down each point rotation (or g3_code_vertex call) by a vec3d subtraction and dot product. It won't slow anything down for polys that are completely clipped on or off by the plane, and will slow each clipped polygon by not much more than any other clipping we do.
Definition at line 381 of file 3dsetup.cpp.
void g3_stop_user_clip_plane | ( | ) |
Stops arbritary plane clipping
Definition at line 408 of file 3dsetup.cpp.
Performs aspect scaling on global view matrix
Definition at line 196 of file 3dsetup.cpp.
float Canv_h2 |
Definition at line 40 of file 3dsetup.cpp.
float Canv_w2 |
Definition at line 39 of file 3dsetup.cpp.
int Canvas_height |
Definition at line 37 of file 3dsetup.cpp.
int Canvas_width |
Definition at line 36 of file 3dsetup.cpp.
int Cmdline_nohtl |
Definition at line 438 of file cmdline.cpp.
float Eye_fov |
Definition at line 28 of file 3dsetup.cpp.
matrix Eye_matrix |
Definition at line 26 of file 3dsetup.cpp.
vec3d Eye_position |
Definition at line 27 of file 3dsetup.cpp.
int G3_count = 0 |
Definition at line 59 of file 3dsetup.cpp.
int G3_frame_count = 0 |
Definition at line 60 of file 3dsetup.cpp.
int G3_user_clip = 0 |
Definition at line 360 of file 3dsetup.cpp.
vec3d G3_user_clip_normal |
Definition at line 361 of file 3dsetup.cpp.
vec3d G3_user_clip_point |
Definition at line 362 of file 3dsetup.cpp.
int instance_depth = 0 |
Definition at line 57 of file 3dsetup.cpp.
struct instance_context instance_stack[MAX_INSTANCE_DEPTH] |
vec3d Light_base |
Definition at line 24 of file 3dsetup.cpp.
matrix Light_matrix |
Definition at line 23 of file 3dsetup.cpp.
vec3d Matrix_scale |
Definition at line 34 of file 3dsetup.cpp.
matrix Object_matrix |
Definition at line 43 of file 3dsetup.cpp.
vec3d Object_position |
Definition at line 42 of file 3dsetup.cpp.
float Proj_fov |
Definition at line 31 of file 3dsetup.cpp.
matrix Unscaled_matrix |
Definition at line 21 of file 3dsetup.cpp.
matrix View_matrix |
Definition at line 19 of file 3dsetup.cpp.
vec3d View_position |
Definition at line 20 of file 3dsetup.cpp.
float View_zoom |
Definition at line 30 of file 3dsetup.cpp.
vec3d Window_scale |
Definition at line 33 of file 3dsetup.cpp.