altEngine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
Bsp Class Reference

#include <bsp.h>

Collaboration diagram for Bsp:
Collaboration graph
[legend]

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_ttex_object
 
unsigned int skybox_index
 
unsigned int skybox_vertex
 
int skybox_ibo
 
int skybox_vbo
 
vector< faceinfo_tface_list
 
vector< faceinfo_tblend_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_ttBsp
 
vec4tangent
 
bool selected_map
 
vertex_tmap_vertex
 
patch_tpatchdata
 
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
 

Constructor & Destructor Documentation

Bsp::Bsp ( )

Member Function Documentation

void Bsp::add_list ( vector< surface_t * > &  surface_list,
bool  blend_flag,
int  i 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void Bsp::CalculateTangentArray ( bspvertex_t vertex,
int  num_vert,
int *  index,
int  num_index,
vec4 tangent 
)

Here is the call graph for this function:

void Bsp::change_axis ( )
private

Here is the caller graph for this function:

void Bsp::check_brush ( brush_t brush,
vec3 start,
vec3 end 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void Bsp::check_node ( int  node_index,
float  start_amount,
float  end_amount,
vec3 start,
vec3 end 
)

Here is the call graph for this function:

Here is the caller graph for this function:

int Bsp::cluster_visible ( int  visCluster,
int  testCluster 
)
inlineprivate

Here is the caller graph for this function:

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 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void Bsp::CreateShadowVolumes ( Graphics gfx,
vec3 light_pos,
int  current_light,
vertex_t shadow_vertex,
unsigned int *  shadow_index,
int &  num_index 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void Bsp::CreateTangentArray ( vertex_t vertex,
bspvertex_t bsp_vertex,
int  num_vert,
vec4 tangent 
)

Here is the caller graph for this function:

int Bsp::find_leaf ( const vec3 position)
inlineprivate

Here is the caller graph for this function:

void Bsp::gen_renderlists ( int  leaf,
vector< surface_t * > &  surface_list,
vec3 position 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void Bsp::generate_meshes ( Graphics gfx)

Here is the call graph for this function:

Here is the caller graph for this function:

const char * Bsp::get_entities ( )

Here is the caller graph for this function:

void Bsp::hitscan ( vec3 origin,
vec3 dir,
float &  distance 
)

Here is the call graph for this function:

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 
)

Here is the caller graph for this function:

bool Bsp::leaf_test ( vec3 x,
vec3 y 
)

Here is the call graph for this function:

bool Bsp::load ( char *  map,
char **  pk3list,
int  num_pk3 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void Bsp::load_from_file ( char *  filename,
texture_t texObj,
Graphics gfx,
char **  pk3_list,
int  num_pk3,
int  anisotropic 
)

Here is the call graph for this function:

Here is the caller graph for this function:

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 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void Bsp::load_textures ( Graphics gfx,
vector< surface_t * > &  surface_list,
char **  pk3_list,
int  num_pk3,
int  anisotropic 
)

Here is the call graph for this function:

Here is the caller graph for this function:

vec3 Bsp::model_origin ( unsigned int  index)

Here is the call graph for this function:

Here is the caller graph for this function:

void Bsp::render ( vec3 position,
Graphics gfx,
vector< surface_t * > &  surface_list,
mLight2 mlight2,
int  tick_num 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void Bsp::render_billboard ( face_t face,
Graphics gfx,
int  stage,
bool  lightmap,
bool  shader 
)
inlineprivate

Here is the call graph for this function:

Here is the caller graph for this function:

void Bsp::render_face ( face_t face,
Graphics gfx,
int  stage,
bool  lightmap,
bool  shader 
)
inlineprivate

Here is the call graph for this function:

Here is the caller graph for this function:

void Bsp::render_model ( unsigned int  index,
Graphics gfx 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void Bsp::render_patch ( face_t face,
Graphics gfx,
int  stage,
bool  lightmap,
bool  shader 
)
inlineprivate

Here is the call graph for this function:

Here is the caller graph for this function:

void Bsp::render_sky ( Graphics gfx,
mLight2 mlight2,
int  tick_num,
vector< surface_t * >  surface_list 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void Bsp::set_blend_mode ( Graphics gfx,
faceinfo_t face 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void Bsp::set_tcmod ( mLight2 mlight2,
faceinfo_t face,
int  tick_num,
float  time 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void Bsp::sort_leaf ( vector< int > *  leaf_list,
int  node_index,
const vec3 position,
leaf_t frameLeaf,
bool  order 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

void Bsp::tessellate ( int  level,
bspvertex_t  control[],
vertex_t **  vertex_array,
int &  numVerts,
int **  index_array,
int &  numIndexes,
vec2 texcoord,
vec2 lightcoord,
vec2 size 
)
private

Here is the call graph for this function:

Here is the caller graph for this function:

vec3 Bsp::trace ( vec3 start,
vec3 end,
vec3 normal 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void Bsp::unload ( Graphics gfx)

Here is the call graph for this function:

Here is the caller graph for this function:

bool Bsp::vis_test ( vec3 x,
vec3 y,
int &  leaf_a,
int &  leaf_b 
)

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

vector<texture_t *> Bsp::anim_list
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
int* Bsp::lightmap_object
private
bool Bsp::loaded
unsigned int Bsp::map_index_vbo
private
char Bsp::map_name[64]
vertex_t* Bsp::map_vertex
private
unsigned int Bsp::map_vertex_vbo
private
unsigned int Bsp::max_stage
int Bsp::mesh_level
private
vec3 Bsp::model_offset[128]
vec3 Bsp::model_rot[128]
int Bsp::model_type[128]
vec3 Bsp::model_vel[128]
int* Bsp::normal_object
private
int Bsp::num_meshes
private
bool Bsp::on_ground
patch_t* Bsp::patchdata
private
unsigned int Bsp::portal_tex
bool Bsp::quake1
bool Bsp::selected_map
private
int Bsp::sky_face
private
int Bsp::skybox_ibo
unsigned int Bsp::skybox_index
int Bsp::skybox_vbo
unsigned int Bsp::skybox_vertex
vec4* Bsp::tangent
private
bsp_t* Bsp::tBsp
private
texture_t* Bsp::tex_object
float Bsp::trace_result

The documentation for this class was generated from the following files: