#include <bsp.h>
Public Member Functions | |
Bsp () | |
void | CreateShadowVolumes (Graphics &gfx, vec3 &light_pos, int current_light, vertex_t *shadow_vertex, unsigned int *shadow_index, int &num_index) |
void | hitscan (vec3 &origin, vec3 &dir, float &distance) |
bool | is_point_in_brush (int brush_index, vec3 &point, vec3 &oldpoint, float *depth, plane_t *plane, content_flag_t &flag, float &water_depth, bool debug) |
bool | vis_test (vec3 &x, vec3 &y, int &leaf_a, int &leaf_b) |
bool | leaf_test (vec3 &x, vec3 &y) |
void | generate_meshes (Graphics &gfx) |
const char * | get_entities () |
void | render (vec3 &position, Graphics &gfx, vector< surface_t * > &surface_list, mLight2 &mlight2, int tick_num) |
void | render_model (unsigned int index, Graphics &gfx) |
void | render_sky (Graphics &gfx, mLight2 &mlight2, int tick_num, vector< surface_t * > surface_list) |
vec3 | model_origin (unsigned int index) |
bool | load (char *map, char **pk3list, int num_pk3) |
void | load_textures (Graphics &gfx, vector< surface_t * > &surface_list, char **pk3_list, int num_pk3, int anisotropic) |
void | load_from_shader (char *name, vector< surface_t * > &surface_list, texture_t *texObj, Graphics &gfx, char **pk3_list, int num_pk3, int anisotropic) |
void | load_from_file (char *filename, texture_t &texObj, Graphics &gfx, char **pk3_list, int num_pk3, int anisotropic) |
void | unload (Graphics &gfx) |
void | CalculateTangentArray (bspvertex_t *vertex, int num_vert, int *index, int num_index, vec4 *tangent) |
void | CreateTangentArray (vertex_t *vertex, bspvertex_t *bsp_vertex, int num_vert, vec4 *tangent) |
bool | collision_detect (vec3 &point, vec3 &oldpoint, plane_t *plane, float *depth, float &water_depth, vector< surface_t * > &surface_list, bool debug, vec3 &clip, const vec3 &velocity, int &model_trigger, int &model_platform, content_flag_t &flag) |
vec3 | trace (vec3 &start, vec3 &end, vec3 &normal) |
void | check_node (int node_index, float start_amount, float end_amount, vec3 &start, vec3 &end) |
void | check_brush (brush_t *brush, vec3 &start, vec3 &end) |
Public Attributes | |
bool | on_ground |
bool | collision |
vec3 | collision_normal |
float | trace_result |
bool | loaded |
bool | quake1 |
bspData_t | data |
char | map_name [64] |
vector< texture_t * > | anim_list |
texture_t * | tex_object |
unsigned int | skybox_index |
unsigned int | skybox_vertex |
int | skybox_ibo |
int | skybox_vbo |
vector< faceinfo_t > | face_list |
vector< faceinfo_t > | blend_list |
vector< int > | leaf_list |
int * | face_to_patch |
int | lastIndex |
int | model_type [128] |
vec3 | model_offset [128] |
vec3 | model_rot [128] |
vec3 | model_vel [128] |
unsigned int | portal_tex |
bool | enable_fog |
bool | enable_textures |
bool | enable_shader |
bool | enable_blend |
bool | enable_patch |
bool | enable_sky |
bool | enable_normalmap |
unsigned int | max_stage |
Private Member Functions | |
void | change_axis () |
int | find_leaf (const vec3 &position) |
void | sort_leaf (vector< int > *leaf_list, int node_index, const vec3 &position, leaf_t *frameLeaf, bool order) |
int | cluster_visible (int visCluster, int testCluster) |
void | tessellate (int level, bspvertex_t control[], vertex_t **vertex_array, int &numVerts, int **index_array, int &numIndexes, vec2 &texcoord, vec2 &lightcoord, vec2 &size) |
void | render_face (face_t *face, Graphics &gfx, int stage, bool lightmap, bool shader) |
void | render_patch (face_t *face, Graphics &gfx, int stage, bool lightmap, bool shader) |
void | render_billboard (face_t *face, Graphics &gfx, int stage, bool lightmap, bool shader) |
void | gen_renderlists (int leaf, vector< surface_t * > &surface_list, vec3 &position) |
void | add_list (vector< surface_t * > &surface_list, bool blend_flag, int i) |
void | set_blend_mode (Graphics &gfx, faceinfo_t &face) |
void | set_tcmod (mLight2 &mlight2, faceinfo_t &face, int tick_num, float time) |
Private Attributes | |
bsp_t * | tBsp |
vec4 * | tangent |
bool | selected_map |
vertex_t * | map_vertex |
patch_t * | patchdata |
int | mesh_level |
int | num_meshes |
unsigned int | map_index_vbo |
unsigned int | map_vertex_vbo |
int * | normal_object |
int * | lightmap_object |
int | sky_face |
Bsp::Bsp | ( | ) |
void Bsp::CalculateTangentArray | ( | bspvertex_t * | vertex, |
int | num_vert, | ||
int * | index, | ||
int | num_index, | ||
vec4 * | tangent | ||
) |
|
private |
void Bsp::check_node | ( | int | node_index, |
float | start_amount, | ||
float | end_amount, | ||
vec3 & | start, | ||
vec3 & | end | ||
) |
|
inlineprivate |
bool Bsp::collision_detect | ( | vec3 & | point, |
vec3 & | oldpoint, | ||
plane_t * | plane, | ||
float * | depth, | ||
float & | water_depth, | ||
vector< surface_t * > & | surface_list, | ||
bool | debug, | ||
vec3 & | clip, | ||
const vec3 & | velocity, | ||
int & | model_trigger, | ||
int & | model_platform, | ||
content_flag_t & | flag | ||
) |
void Bsp::CreateShadowVolumes | ( | Graphics & | gfx, |
vec3 & | light_pos, | ||
int | current_light, | ||
vertex_t * | shadow_vertex, | ||
unsigned int * | shadow_index, | ||
int & | num_index | ||
) |
void Bsp::CreateTangentArray | ( | vertex_t * | vertex, |
bspvertex_t * | bsp_vertex, | ||
int | num_vert, | ||
vec4 * | tangent | ||
) |
|
inlineprivate |
|
private |
void Bsp::generate_meshes | ( | Graphics & | gfx | ) |
const char * Bsp::get_entities | ( | ) |
bool Bsp::is_point_in_brush | ( | int | brush_index, |
vec3 & | point, | ||
vec3 & | oldpoint, | ||
float * | depth, | ||
plane_t * | plane, | ||
content_flag_t & | flag, | ||
float & | water_depth, | ||
bool | debug | ||
) |
bool Bsp::load | ( | char * | map, |
char ** | pk3list, | ||
int | num_pk3 | ||
) |
void Bsp::load_from_file | ( | char * | filename, |
texture_t & | texObj, | ||
Graphics & | gfx, | ||
char ** | pk3_list, | ||
int | num_pk3, | ||
int | anisotropic | ||
) |
void Bsp::load_from_shader | ( | char * | name, |
vector< surface_t * > & | surface_list, | ||
texture_t * | texObj, | ||
Graphics & | gfx, | ||
char ** | pk3_list, | ||
int | num_pk3, | ||
int | anisotropic | ||
) |
void Bsp::load_textures | ( | Graphics & | gfx, |
vector< surface_t * > & | surface_list, | ||
char ** | pk3_list, | ||
int | num_pk3, | ||
int | anisotropic | ||
) |
vec3 Bsp::model_origin | ( | unsigned int | index | ) |
void Bsp::render | ( | vec3 & | position, |
Graphics & | gfx, | ||
vector< surface_t * > & | surface_list, | ||
mLight2 & | mlight2, | ||
int | tick_num | ||
) |
|
inlineprivate |
|
inlineprivate |
void Bsp::render_model | ( | unsigned int | index, |
Graphics & | gfx | ||
) |
|
inlineprivate |
void Bsp::render_sky | ( | Graphics & | gfx, |
mLight2 & | mlight2, | ||
int | tick_num, | ||
vector< surface_t * > | surface_list | ||
) |
|
private |
|
private |
|
private |
|
private |
void Bsp::unload | ( | Graphics & | gfx | ) |
vector<faceinfo_t> Bsp::blend_list |
bool Bsp::collision |
vec3 Bsp::collision_normal |
bspData_t Bsp::data |
bool Bsp::enable_blend |
bool Bsp::enable_fog |
bool Bsp::enable_normalmap |
bool Bsp::enable_patch |
bool Bsp::enable_shader |
bool Bsp::enable_sky |
bool Bsp::enable_textures |
vector<faceinfo_t> Bsp::face_list |
int* Bsp::face_to_patch |
int Bsp::lastIndex |
vector<int> Bsp::leaf_list |
|
private |
bool Bsp::loaded |
|
private |
char Bsp::map_name[64] |
|
private |
|
private |
unsigned int Bsp::max_stage |
|
private |
vec3 Bsp::model_offset[128] |
vec3 Bsp::model_rot[128] |
int Bsp::model_type[128] |
vec3 Bsp::model_vel[128] |
|
private |
|
private |
bool Bsp::on_ground |
|
private |
unsigned int Bsp::portal_tex |
bool Bsp::quake1 |
|
private |
|
private |
int Bsp::skybox_ibo |
unsigned int Bsp::skybox_index |
int Bsp::skybox_vbo |
unsigned int Bsp::skybox_vertex |
|
private |
|
private |
texture_t* Bsp::tex_object |
float Bsp::trace_result |