FS2_Open
Open source remastering of the Freespace 2 engine
model.h File Reference
#include "globalincs/globals.h"
#include "globalincs/pstypes.h"
#include "graphics/2d.h"
#include "object/object.h"

Go to the source code of this file.

Classes

struct  submodel_instance_info
 
struct  submodel_instance
 
struct  polymodel_instance
 
struct  stepped_rotation
 
struct  model_subsystem
 
struct  model_special
 
struct  model_tmap_vert
 
struct  bsp_collision_node
 
struct  bsp_collision_leaf
 
struct  bsp_collision_tree
 
class  bsp_info
 
struct  mp_vert
 
struct  model_path
 
struct  w_bank
 
struct  glow_point
 
struct  thruster_bank
 
struct  glow_point_bank
 
struct  glow_point_bank_override
 
struct  dock_bay
 
struct  ship_bay
 
struct  shield_tri
 
struct  shield_vertex
 
struct  shield_info
 
struct  bsp_light
 
struct  model_octant
 
struct  eye
 
struct  cross_section
 
struct  insignia
 
class  texture_info
 
class  texture_map
 
class  polymodel
 
struct  mc_info
 
struct  mst_info
 

Macros

#define MAX_DEBRIS_OBJECTS   32
 
#define MAX_MODEL_DETAIL_LEVELS   8
 
#define MAX_PROP_LEN   256
 
#define MAX_NAME_LEN   32
 
#define MAX_ARC_EFFECTS   8
 
#define MOVEMENT_TYPE_NONE   -1
 
#define MOVEMENT_TYPE_POS   0
 
#define MOVEMENT_TYPE_ROT   1
 
#define MOVEMENT_TYPE_ROT_SPECIAL   2
 
#define MOVEMENT_TYPE_TRIGGERED   3
 
#define MOVEMENT_TYPE_INTRINSIC_ROTATE   4
 
#define MOVEMENT_TYPE_LOOK_AT   5
 
#define MOVEMENT_AXIS_NONE   -1
 
#define MOVEMENT_AXIS_X   0
 
#define MOVEMENT_AXIS_Y   2
 
#define MOVEMENT_AXIS_Z   1
 
#define SUBSYSTEM_NONE   0
 
#define SUBSYSTEM_ENGINE   1
 
#define SUBSYSTEM_TURRET   2
 
#define SUBSYSTEM_RADAR   3
 
#define SUBSYSTEM_NAVIGATION   4
 
#define SUBSYSTEM_COMMUNICATION   5
 
#define SUBSYSTEM_WEAPONS   6
 
#define SUBSYSTEM_SENSORS   7
 
#define SUBSYSTEM_SOLAR   8
 
#define SUBSYSTEM_GAS_COLLECT   9
 
#define SUBSYSTEM_ACTIVATION   10
 
#define SUBSYSTEM_UNKNOWN   11
 
#define SUBSYSTEM_MAX   12
 
#define MAX_TFP   10
 
#define MAX_SPLIT_PLANE   5
 
#define MAX_MODEL_SUBSYSTEMS   200
 
#define MSS_FLAG_ROTATES   (1 << 0)
 
#define MSS_FLAG_STEPPED_ROTATE   (1 << 1)
 
#define MSS_FLAG_AI_ROTATE   (1 << 2)
 
#define MSS_FLAG_CREWPOINT   (1 << 3)
 
#define MSS_FLAG_TURRET_MATRIX   (1 << 4)
 
#define MSS_FLAG_AWACS   (1 << 5)
 
#define MSS_FLAG_ARTILLERY   (1 << 6)
 
#define MSS_FLAG_TRIGGERED   (1 << 7)
 
#define MSS_FLAG_UNTARGETABLE   (1 << 8)
 
#define MSS_FLAG_CARRY_NO_DAMAGE   (1 << 9)
 
#define MSS_FLAG_USE_MULTIPLE_GUNS   (1 << 10)
 
#define MSS_FLAG_FIRE_ON_NORMAL   (1 << 11)
 
#define MSS_FLAG_TURRET_HULL_CHECK   (1 << 12)
 
#define MSS_FLAG_TURRET_FIXED_FP   (1 << 13)
 
#define MSS_FLAG_TURRET_SALVO   (1 << 14)
 
#define MSS_FLAG_FIRE_ON_TARGET   (1 << 15)
 
#define MSS_FLAG_NO_SS_TARGETING   (1 << 16)
 
#define MSS_FLAG_TURRET_RESET_IDLE   (1 << 17)
 
#define MSS_FLAG_TURRET_ALT_MATH   (1 << 18)
 
#define MSS_FLAG_CARRY_SHOCKWAVE   (1 << 19)
 
#define MSS_FLAG_ALLOW_LANDING   (1 << 20)
 
#define MSS_FLAG_FOV_EDGE_CHECK   (1 << 21)
 
#define MSS_FLAG_FOV_REQUIRED   (1 << 22)
 
#define MSS_FLAG_NO_REPLACE   (1 << 23)
 
#define MSS_FLAG_NO_LIVE_DEBRIS   (1 << 24)
 
#define MSS_FLAG_IGNORE_IF_DEAD   (1 << 25)
 
#define MSS_FLAG_ALLOW_VANISHING   (1 << 26)
 
#define MSS_FLAG_DAMAGE_AS_HULL   (1 << 27)
 
#define MSS_FLAG_TURRET_LOCKED   (1 << 28)
 
#define MSS_FLAG_NO_AGGREGATE   (1 << 29)
 
#define MSS_FLAG_TURRET_ANIM_WAIT   (1 << 30)
 
#define MSS_FLAG2_PLAYER_TURRET_SOUND   (1 << 0)
 
#define MSS_FLAG2_TURRET_ONLY_TARGET_IF_CAN_FIRE   (1 << 1)
 
#define MSS_FLAG2_NO_DISAPPEAR   (1 << 2)
 
#define MSS_FLAG2_COLLIDE_SUBMODEL   (1 << 3)
 
#define MSS_FLAG2_DESTROYED_ROTATION   (1 << 4)
 
#define MSS_FLAG2_TURRET_USE_AMMO   (1 << 5)
 
#define MSS_FLAG2_AUTOREPAIR_IF_DISABLED   (1 << 6)
 
#define MSS_FLAG2_NO_AUTOREPAIR_IF_DISABLED   (1 << 7)
 
#define MSS_FLAG2_SHARE_FIRE_DIRECTION   (1 << 8)
 
#define NUM_SUBSYSTEM_FLAGS   33
 
#define MSS_MODEL_FLAG_MASK   (MSS_FLAG_CREWPOINT | MSS_FLAG_ROTATES | MSS_FLAG_TRIGGERED | MSS_FLAG_ARTILLERY | MSS_FLAG_STEPPED_ROTATE)
 
#define MSS_MODEL_FLAG2_MASK   0
 
#define MARC_TYPE_NORMAL   0
 
#define MARC_TYPE_EMP   1
 
#define MAX_LIVE_DEBRIS   7
 
#define MP_TYPE_UNUSED   0
 
#define MP_TYPE_SUBSYS   1
 
#define MAX_SLOTS   25
 
#define PULSE_SIN   1
 
#define PULSE_COS   2
 
#define PULSE_TRI   3
 
#define PULSE_SHIFTTRI   4
 
#define DOCK_TYPE_CARGO   (1<<0)
 
#define DOCK_TYPE_REARM   (1<<1)
 
#define DOCK_TYPE_GENERIC   (1<<2)
 
#define MAX_DOCK_SLOTS   2
 
#define MAX_SHIP_BAY_PATHS   31
 
#define BSP_LIGHT_TYPE_WEAPON   1
 
#define BSP_LIGHT_TYPE_THRUSTER   2
 
#define MAX_EYES   10
 
#define MAX_MODEL_INSIGNIAS   6
 
#define MAX_INS_FACE_VECS   3
 
#define MAX_INS_VECS   81
 
#define MAX_INS_FACES   128
 
#define PM_FLAG_ALLOW_TILING   (1<<0)
 
#define PM_FLAG_AUTOCEN   (1<<1)
 
#define PM_FLAG_TRANS_BUFFER   (1<<2)
 
#define PM_FLAG_BATCHED   (1<<3)
 
#define PM_FLAG_HAS_INTRINSIC_ROTATE   (1<<4)
 
#define TM_BASE_TYPE   0
 
#define TM_GLOW_TYPE   1
 
#define TM_SPECULAR_TYPE   2
 
#define TM_NORMAL_TYPE   3
 
#define TM_HEIGHT_TYPE   4
 
#define TM_MISC_TYPE   5
 
#define TM_NUM_TYPES   6
 
#define MAX_REPLACEMENT_TEXTURES   MAX_MODEL_TEXTURES * TM_NUM_TYPES
 
#define REPLACE_WITH_INVISIBLE   -47
 
#define MR_NORMAL   (0)
 
#define MR_SHOW_OUTLINE   (1<<0)
 
#define MR_SKYBOX   (1<<1)
 
#define MR_DESATURATED   (1<<2)
 
#define MR_EMPTY_SLOT0   (1<<3)
 
#define MR_EMPTY_SLOT1   (1<<4)
 
#define MR_SHOW_THRUSTERS   (1<<5)
 
#define MR_EMPTY_SLOT2   (1<<6)
 
#define MR_NO_POLYS   (1<<7)
 
#define MR_NO_LIGHTING   (1<<8)
 
#define MR_NO_TEXTURING   (1<<9)
 
#define MR_NO_CORRECT   (1<<10)
 
#define MR_NO_SMOOTHING   (1<<11)
 
#define MR_IS_ASTEROID   (1<<12)
 
#define MR_IS_MISSILE   (1<<13)
 
#define MR_SHOW_OUTLINE_PRESET   (1<<14)
 
#define MR_SHOW_INVISIBLE_FACES   (1<<15)
 
#define MR_AUTOCENTER   (1<<16)
 
#define MR_EMPTY_SLOT3   (1<<17)
 
#define MR_ALL_XPARENT   (1<<18)
 
#define MR_NO_ZBUFFER   (1<<19)
 
#define MR_NO_CULL   (1<<20)
 
#define MR_EMPTY_SLOT4   (1<<21)
 
#define MR_NO_BATCH   (1<<22)
 
#define MR_EDGE_ALPHA   (1<<23)
 
#define MR_CENTER_ALPHA   (1<<24)
 
#define MR_NO_FOGGING   (1<<25)
 
#define MR_SHOW_OUTLINE_HTL   (1<<26)
 
#define MR_NO_GLOWMAPS   (1<<27)
 
#define MR_FULL_DETAIL   (1<<28)
 
#define MR_FORCE_CLAMP   (1<<29)
 
#define MR_EMPTY_SLOT5   (1<<30)
 
#define MR_ATTACHED_MODEL   (1<<31)
 
#define MR_DEPRECATED_NORMAL   (0)
 
#define MR_DEPRECATED_SHOW_OUTLINE   (1<<0)
 
#define MR_DEPRECATED_SHOW_PIVOTS   (1<<1)
 
#define MR_DEPRECATED_SHOW_PATHS   (1<<2)
 
#define MR_DEPRECATED_SHOW_RADIUS   (1<<3)
 
#define MR_DEPRECATED_SHOW_SHIELDS   (1<<4)
 
#define MR_DEPRECATED_SHOW_THRUSTERS   (1<<5)
 
#define MR_DEPRECATED_LOCK_DETAIL   (1<<6)
 
#define MR_DEPRECATED_NO_POLYS   (1<<7)
 
#define MR_DEPRECATED_NO_LIGHTING   (1<<8)
 
#define MR_DEPRECATED_NO_TEXTURING   (1<<9)
 
#define MR_DEPRECATED_NO_CORRECT   (1<<10)
 
#define MR_DEPRECATED_NO_SMOOTHING   (1<<11)
 
#define MR_DEPRECATED_IS_ASTEROID   (1<<12)
 
#define MR_DEPRECATED_IS_MISSILE   (1<<13)
 
#define MR_DEPRECATED_SHOW_OUTLINE_PRESET   (1<<14)
 
#define MR_DEPRECATED_SHOW_INVISIBLE_FACES   (1<<15)
 
#define MR_DEPRECATED_AUTOCENTER   (1<<16)
 
#define MR_DEPRECATED_BAY_PATHS   (1<<17)
 
#define MR_DEPRECATED_ALL_XPARENT   (1<<18)
 
#define MR_DEPRECATED_NO_ZBUFFER   (1<<19)
 
#define MR_DEPRECATED_NO_CULL   (1<<20)
 
#define MR_DEPRECATED_FORCE_TEXTURE   (1<<21)
 
#define MR_DEPRECATED_FORCE_LOWER_DETAIL   (1<<22)
 
#define MR_DEPRECATED_EDGE_ALPHA   (1<<23)
 
#define MR_DEPRECATED_CENTER_ALPHA   (1<<24)
 
#define MR_DEPRECATED_NO_FOGGING   (1<<25)
 
#define MR_DEPRECATED_SHOW_OUTLINE_HTL   (1<<26)
 
#define MR_DEPRECATED_NO_GLOWMAPS   (1<<27)
 
#define MR_DEPRECATED_FULL_DETAIL   (1<<28)
 
#define MR_DEPRECATED_FORCE_CLAMP   (1<<29)
 
#define MR_DEPRECATED_ANIMATED_SHADER   (1<<30)
 
#define MR_DEPRECATED_ATTACHED_MODEL   (1<<31)
 
#define MR_DEBUG_PIVOTS   (1<<0)
 
#define MR_DEBUG_PATHS   (1<<1)
 
#define MR_DEBUG_RADIUS   (1<<2)
 
#define MR_DEBUG_SHIELDS   (1<<3)
 
#define MR_DEBUG_BAY_PATHS   (1<<4)
 
#define MODEL_RENDER_OPAQUE   1
 
#define MODEL_RENDER_TRANS   2
 
#define MODEL_RENDER_ALL   3
 
#define MC_CHECK_MODEL   (1<<0)
 
#define MC_CHECK_SHIELD   (1<<1)
 
#define MC_ONLY_SPHERE   (1<<2)
 
#define MC_ONLY_BOUND_BOX   (1<<3)
 
#define MC_CHECK_RAY   (1<<4)
 
#define MC_CHECK_SPHERELINE   (1<<5)
 
#define MC_SUBMODEL   (1<<6)
 
#define MC_SUBMODEL_INSTANCE   (1<<7)
 
#define MC_CHECK_INVISIBLE_FACES   (1<<8)
 

Typedefs

typedef struct submodel_instance_info submodel_instance_info
 
typedef struct submodel_instance submodel_instance
 
typedef struct polymodel_instance polymodel_instance
 
typedef struct stepped_rotation stepped_rotation_t
 
typedef struct model_subsystem model_subsystem
 
typedef struct model_special model_special
 
typedef struct model_tmap_vert model_tmap_vert
 
typedef struct mp_vert mp_vert
 
typedef struct model_path model_path
 
typedef struct w_bank w_bank
 
typedef struct thruster_bank thruster_bank
 
typedef struct glow_point_bank glow_point_bank
 
typedef struct glow_point_bank_override glow_point_bank_override
 
typedef struct dock_bay dock_bay
 
typedef struct ship_bay ship_bay_t
 
typedef struct shield_tri shield_tri
 
typedef struct shield_vertex shield_vertex
 
typedef struct shield_info shield_info
 
typedef struct bsp_light bsp_light
 
typedef struct model_octant model_octant
 
typedef struct eye eye
 
typedef struct cross_section cross_section
 
typedef struct insignia insignia
 
typedef struct mc_info mc_info
 
typedef struct mst_info mst_info
 

Functions

void parse_triggersint (int &n_trig, queued_animation **triggers, char *props)
 
void model_init ()
 
void model_unload (int modelnum, int force=0)
 
void model_free_all ()
 
void model_instance_free_all ()
 
int model_load (char *filename, int n_subsystems, model_subsystem *subsystems, int ferror=1, int duplicate=0)
 
int model_create_instance (bool is_ship, int model_num)
 
void model_delete_instance (int model_instance_num)
 
void model_load_texture (polymodel *pm, int i, char *file)
 
polymodelmodel_get (int model_num)
 
polymodel_instancemodel_get_instance (int model_instance_num)
 
void model_copy_subsystems (int n_subsystems, model_subsystem *d_sp, model_subsystem *s_sp)
 
void model_set_outline_color (int r, int g, int b)
 
void model_set_outline_color_fast (void *outline_color)
 
void model_set_detail_level (int n)
 
void model_render_DEPRECATED (int model_num, matrix *orient, vec3d *pos, uint flags=MR_DEPRECATED_NORMAL, int objnum=-1, int lighting_skip=-1, int *replacement_textures=NULL, int render=MODEL_RENDER_ALL, const bool is_skybox=false)
 
void submodel_render_DEPRECATED (int model_num, int submodel_num, matrix *orient, vec3d *pos, uint flags=MR_DEPRECATED_NORMAL, int objnum=-1, int *replacement_textures=NULL, int render=MODEL_RENDER_ALL)
 
float model_get_radius (int modelnum)
 
float submodel_get_radius (int modelnum, int submodelnum)
 
float model_get_core_radius (int modelnum)
 
int model_find_2d_bound (int model_num, matrix *orient, vec3d *pos, int *x1, int *y1, int *x2, int *y2)
 
int model_find_2d_bound_min (int model_num, matrix *orient, vec3d *pos, int *x1, int *y1, int *x2, int *y2)
 
int submodel_find_2d_bound_min (int model_num, int submodel, matrix *orient, vec3d *pos, int *x1, int *y1, int *x2, int *y2)
 
int subobj_find_2d_bound (float radius, matrix *orient, vec3d *pos, int *x1, int *y1, int *x2, int *y2)
 
int model_rotate_gun (int model_num, model_subsystem *turret, matrix *orient, angles *base_angles, angles *gun_angles, vec3d *pos, vec3d *dst, int obj_idx, bool reset=false)
 
void model_make_turret_matrix (int model_num, model_subsystem *turret)
 
void submodel_rotate (model_subsystem *psub, submodel_instance_info *sii)
 
void submodel_rotate (bsp_info *sm, submodel_instance_info *sii)
 
void submodel_stepped_rotate (model_subsystem *psub, submodel_instance_info *sii)
 
void model_find_submodel_offset (vec3d *outpnt, int model_num, int sub_model_num)
 
void model_find_world_point (vec3d *outpnt, vec3d *mpnt, int model_num, int submodel_num, const matrix *objorient, const vec3d *objpos)
 
void model_instance_find_world_point (vec3d *outpnt, vec3d *mpnt, int model_instance_num, int submodel_num, const matrix *objorient, const vec3d *objpos)
 
void world_find_model_point (vec3d *out, vec3d *world_pt, const polymodel *pm, int submodel_num, const matrix *orient, const vec3d *pos)
 
void world_find_model_instance_point (vec3d *out, vec3d *world_pt, const polymodel_instance *pmi, int submodel_num, const matrix *orient, const vec3d *pos)
 
void find_submodel_instance_point (vec3d *outpnt, int model_instance_num, int submodel_num)
 
void find_submodel_instance_point_normal (vec3d *outpnt, vec3d *outnorm, int model_instance_num, int submodel_num, const vec3d *submodel_pnt, const vec3d *submodel_norm)
 
void find_submodel_instance_point_orient (vec3d *outpnt, matrix *outorient, int model_instance_num, int submodel_num, const vec3d *submodel_pnt, const matrix *submodel_orient)
 
void find_submodel_instance_world_point (vec3d *outpnt, int model_instance_num, int submodel_num, const matrix *objorient, const vec3d *objpos)
 
void model_get_rotating_submodel_list (SCP_vector< int > *submodel_vector, object *objp)
 
void model_get_submodel_tree_list (SCP_vector< int > &submodel_vector, polymodel *pm, int mn)
 
void model_init_submodel_axis_pt (submodel_instance_info *sii, int model_num, int submodel_num)
 
void model_find_world_dir (vec3d *out_dir, vec3d *in_dir, int model_num, int submodel_num, const matrix *objorient)
 
void model_instance_find_world_dir (vec3d *out_dir, vec3d *in_dir, int model_instance_num, int submodel_num, const matrix *objorient)
 
void model_clear_instance (int model_num)
 
void model_clear_submodel_instance (submodel_instance *sm_instance, bsp_info *sm)
 
void model_clear_submodel_instances (int model_instance_num)
 
void model_set_instance_info (submodel_instance_info *sii, float turn_rate, float turn_accel)
 
void model_clear_instance_info (submodel_instance_info *sii)
 
void model_set_instance (int model_num, int sub_model_num, submodel_instance_info *sii, int flags=0)
 
void model_set_instance_techroom (int model_num, int sub_model_num, float angle_1, float angle_2)
 
void model_update_instance (int model_instance_num, int sub_model_num, submodel_instance_info *sii, int flags)
 
void model_add_arc (int model_num, int sub_model_num, vec3d *v1, vec3d *v2, int arc_type)
 
int submodel_get_points (int model_num, int submodel_num, int max_num, vec3d **nts)
 
void submodel_get_two_random_points (int model_num, int submodel_num, vec3d *v1, vec3d *v2, vec3d *n1=NULL, vec3d *n2=NULL)
 
void submodel_get_two_random_points_better (int model_num, int submodel_num, vec3d *v1, vec3d *v2)
 
int model_find_dock_index (int modelnum, int dock_type, int index_to_start_at=0)
 
int model_find_dock_name_index (int modelnum, char *name)
 
char * model_get_dock_name (int modelnum, int index)
 
int model_get_num_dock_points (int modelnum)
 
int model_get_dock_index_type (int modelnum, int index)
 
int model_get_dock_types (int modelnum)
 
int model_find_bay_path (int modelnum, char *bay_path_name)
 
int submodel_get_num_verts (int model_num, int submodel_num)
 
int submodel_get_num_polys (int model_num, int submodel_num)
 
void model_find_obj_dir (vec3d *w_vec, vec3d *m_vec, int model_instance_num, int submodel_num, matrix *objorient)
 
void model_instance_find_obj_dir (vec3d *w_vec, vec3d *m_vec, int model_instance_num, int submodel_num, matrix *objorient)
 
void mc_info_init (mc_info *mc)
 
int model_collide (mc_info *mc_info_obj)
 
void model_collide_parse_bsp (bsp_collision_tree *tree, void *model_ptr, int version)
 
bsp_collision_treemodel_get_bsp_collision_tree (int tree_index)
 
void model_remove_bsp_collision_tree (int tree_index)
 
int model_create_bsp_collision_tree ()
 
void model_collide_preprocess (matrix *orient, int model_instance_num, int detail=0)
 
void model_show_damaged (int model_num, int show_damaged)
 
int model_which_octant_distant (vec3d *pnt, int model_num, matrix *model_orient, vec3d *model_pos, model_octant **oct)
 
int model_which_octant (vec3d *pnt, int model_num, matrix *model_orient, vec3d *model_pos, model_octant **oct)
 
void model_set_thrust (int model_num=-1, mst_info *mst=NULL)
 
float model_find_closest_point (vec3d *outpnt, int model_num, int submodel_num, matrix *orient, vec3d *pos, vec3d *eye_pos)
 
void model_set_insignia_bitmap (int bmap)
 
void model_set_alpha (float alpha)
 
void model_set_forced_texture (int bmap)
 
int model_find_texture (int model_num, int bitmap)
 
float get_world_closest_box_point_with_delta (vec3d *closest_box_point, object *box_obj, vec3d *start_point, int *is_inside, float delta)
 
void model_page_in_textures (int modelnum, int ship_info_index=-1)
 
void model_page_out_textures (int model_num, bool release=false)
 
void model_set_warp_globals (float scale_x=1.0f, float scale_y=1.0f, float scale_z=1.0f, int bitmap_id=-1, float alpha=-1.0f)
 
void model_set_replacement_textures (int *replacement_textures)
 
void model_setup_cloak (vec3d *shift, int full_cloak, int alpha)
 
void model_finish_cloak (int full_cloak)
 
void model_do_look_at (int model_num)
 
void model_do_intrinsic_rotations (int model_instance_num=-1)
 
int model_should_render_engine_glow (int objnum, int bank_obj)
 
void model_interp_set_clip_plane (vec3d *pos=NULL, vec3d *normal=NULL)
 
void model_interp_set_animated_effect_and_timer (int effect_num=0, float effect_timer=0.0f)
 
bool model_get_team_color (team_color *clr, const SCP_string &team, const SCP_string &secondaryteam, fix timestamp, int fadetime)
 
void model_interp_set_team_color (const SCP_string &team, const SCP_string &secondaryteam, fix timestamp, int fadetime)
 
void moldel_calc_facing_pts (vec3d *top, vec3d *bot, vec3d *fvec, vec3d *pos, float w, float z_add, vec3d *Eyeposition)
 
void interp_render_arc (vec3d *v1, vec3d *v2, color *primary, color *secondary, float arc_width)
 
void model_render_insignias (polymodel *pm, int detail_level, int bitmap_num)
 
void model_draw_debug_points (polymodel *pm, bsp_info *submodel, uint flags)
 
void model_render_shields (polymodel *pm, uint flags)
 
void model_draw_paths (int model_num, uint flags)
 
void model_draw_paths_htl (int model_num, uint flags)
 
void model_draw_bay_paths (int model_num)
 
void model_draw_bay_paths_htl (int model_num)
 
void glowpoint_init ()
 
SCP_vector< glow_point_bank_override >::iterator get_glowpoint_bank_override_by_name (const char *name)
 

Variables

flag_def_list model_render_flags []
 
int model_render_flags_size
 
char * Subsystem_types [SUBSYSTEM_MAX]
 
flag_def_list Dock_type_names []
 
int Num_dock_type_names
 
int modelstats_num_polys
 
int modelstats_num_polys_drawn
 
int modelstats_num_verts
 
int modelstats_num_sortnorms
 
SCP_vector< glow_point_bank_overrideglowpoint_bank_overrides
 

Macro Definition Documentation

#define BSP_LIGHT_TYPE_THRUSTER   2

Definition at line 574 of file model.h.

#define BSP_LIGHT_TYPE_WEAPON   1

Definition at line 573 of file model.h.

#define DOCK_TYPE_CARGO   (1<<0)

Definition at line 518 of file model.h.

#define DOCK_TYPE_GENERIC   (1<<2)

Definition at line 520 of file model.h.

#define DOCK_TYPE_REARM   (1<<1)

Definition at line 519 of file model.h.

#define MARC_TYPE_EMP   1

Definition at line 253 of file model.h.

#define MARC_TYPE_NORMAL   0

Definition at line 252 of file model.h.

#define MAX_ARC_EFFECTS   8

Definition at line 30 of file model.h.

#define MAX_DEBRIS_OBJECTS   32

Definition at line 26 of file model.h.

#define MAX_DOCK_SLOTS   2

Definition at line 522 of file model.h.

#define MAX_EYES   10

Definition at line 592 of file model.h.

#define MAX_INS_FACE_VECS   3

Definition at line 606 of file model.h.

#define MAX_INS_FACES   128

Definition at line 608 of file model.h.

#define MAX_INS_VECS   81

Definition at line 607 of file model.h.

#define MAX_LIVE_DEBRIS   7

Definition at line 255 of file model.h.

#define MAX_MODEL_DETAIL_LEVELS   8

Definition at line 27 of file model.h.

#define MAX_MODEL_INSIGNIAS   6

Definition at line 605 of file model.h.

#define MAX_MODEL_SUBSYSTEMS   200

Definition at line 103 of file model.h.

#define MAX_NAME_LEN   32

Definition at line 29 of file model.h.

#define MAX_PROP_LEN   256

Definition at line 28 of file model.h.

#define MAX_REPLACEMENT_TEXTURES   MAX_MODEL_TEXTURES * TM_NUM_TYPES

Definition at line 690 of file model.h.

#define MAX_SHIP_BAY_PATHS   31

Definition at line 538 of file model.h.

#define MAX_SLOTS   25

Definition at line 430 of file model.h.

#define MAX_SPLIT_PLANE   5

Definition at line 71 of file model.h.

#define MAX_TFP   10

Definition at line 69 of file model.h.

#define MC_CHECK_INVISIBLE_FACES   (1<<8)

Definition at line 1180 of file model.h.

#define MC_CHECK_MODEL   (1<<0)

Definition at line 1169 of file model.h.

#define MC_CHECK_RAY   (1<<4)

Definition at line 1176 of file model.h.

#define MC_CHECK_SHIELD   (1<<1)

Definition at line 1170 of file model.h.

#define MC_CHECK_SPHERELINE   (1<<5)

Definition at line 1177 of file model.h.

#define MC_ONLY_BOUND_BOX   (1<<3)

Definition at line 1173 of file model.h.

#define MC_ONLY_SPHERE   (1<<2)

Definition at line 1171 of file model.h.

#define MC_SUBMODEL   (1<<6)

Definition at line 1178 of file model.h.

#define MC_SUBMODEL_INSTANCE   (1<<7)

Definition at line 1179 of file model.h.

#define MODEL_RENDER_ALL   3

Definition at line 935 of file model.h.

#define MODEL_RENDER_OPAQUE   1

Definition at line 933 of file model.h.

#define MODEL_RENDER_TRANS   2

Definition at line 934 of file model.h.

#define MOVEMENT_AXIS_NONE   -1

Definition at line 42 of file model.h.

#define MOVEMENT_AXIS_X   0

Definition at line 43 of file model.h.

#define MOVEMENT_AXIS_Y   2

Definition at line 44 of file model.h.

#define MOVEMENT_AXIS_Z   1

Definition at line 45 of file model.h.

#define MOVEMENT_TYPE_INTRINSIC_ROTATE   4

Definition at line 37 of file model.h.

#define MOVEMENT_TYPE_LOOK_AT   5

Definition at line 38 of file model.h.

#define MOVEMENT_TYPE_NONE   -1

Definition at line 32 of file model.h.

#define MOVEMENT_TYPE_POS   0

Definition at line 33 of file model.h.

#define MOVEMENT_TYPE_ROT   1

Definition at line 34 of file model.h.

#define MOVEMENT_TYPE_ROT_SPECIAL   2

Definition at line 35 of file model.h.

#define MOVEMENT_TYPE_TRIGGERED   3

Definition at line 36 of file model.h.

#define MP_TYPE_SUBSYS   1

Definition at line 405 of file model.h.

#define MP_TYPE_UNUSED   0

Definition at line 404 of file model.h.

#define MR_ALL_XPARENT   (1<<18)

Definition at line 877 of file model.h.

#define MR_ATTACHED_MODEL   (1<<31)

Definition at line 890 of file model.h.

#define MR_AUTOCENTER   (1<<16)

Definition at line 875 of file model.h.

#define MR_CENTER_ALPHA   (1<<24)

Definition at line 883 of file model.h.

#define MR_DEBUG_BAY_PATHS   (1<<4)

Definition at line 930 of file model.h.

#define MR_DEBUG_PATHS   (1<<1)

Definition at line 927 of file model.h.

#define MR_DEBUG_PIVOTS   (1<<0)

Definition at line 926 of file model.h.

#define MR_DEBUG_RADIUS   (1<<2)

Definition at line 928 of file model.h.

#define MR_DEBUG_SHIELDS   (1<<3)

Definition at line 929 of file model.h.

#define MR_DEPRECATED_ALL_XPARENT   (1<<18)

Definition at line 911 of file model.h.

#define MR_DEPRECATED_ANIMATED_SHADER   (1<<30)

Definition at line 923 of file model.h.

#define MR_DEPRECATED_ATTACHED_MODEL   (1<<31)

Definition at line 924 of file model.h.

#define MR_DEPRECATED_AUTOCENTER   (1<<16)

Definition at line 909 of file model.h.

#define MR_DEPRECATED_BAY_PATHS   (1<<17)

Definition at line 910 of file model.h.

#define MR_DEPRECATED_CENTER_ALPHA   (1<<24)

Definition at line 917 of file model.h.

#define MR_DEPRECATED_EDGE_ALPHA   (1<<23)

Definition at line 916 of file model.h.

#define MR_DEPRECATED_FORCE_CLAMP   (1<<29)

Definition at line 922 of file model.h.

#define MR_DEPRECATED_FORCE_LOWER_DETAIL   (1<<22)

Definition at line 915 of file model.h.

#define MR_DEPRECATED_FORCE_TEXTURE   (1<<21)

Definition at line 914 of file model.h.

#define MR_DEPRECATED_FULL_DETAIL   (1<<28)

Definition at line 921 of file model.h.

#define MR_DEPRECATED_IS_ASTEROID   (1<<12)

Definition at line 905 of file model.h.

#define MR_DEPRECATED_IS_MISSILE   (1<<13)

Definition at line 906 of file model.h.

#define MR_DEPRECATED_LOCK_DETAIL   (1<<6)

Definition at line 899 of file model.h.

#define MR_DEPRECATED_NO_CORRECT   (1<<10)

Definition at line 903 of file model.h.

#define MR_DEPRECATED_NO_CULL   (1<<20)

Definition at line 913 of file model.h.

#define MR_DEPRECATED_NO_FOGGING   (1<<25)

Definition at line 918 of file model.h.

#define MR_DEPRECATED_NO_GLOWMAPS   (1<<27)

Definition at line 920 of file model.h.

#define MR_DEPRECATED_NO_LIGHTING   (1<<8)

Definition at line 901 of file model.h.

#define MR_DEPRECATED_NO_POLYS   (1<<7)

Definition at line 900 of file model.h.

#define MR_DEPRECATED_NO_SMOOTHING   (1<<11)

Definition at line 904 of file model.h.

#define MR_DEPRECATED_NO_TEXTURING   (1<<9)

Definition at line 902 of file model.h.

#define MR_DEPRECATED_NO_ZBUFFER   (1<<19)

Definition at line 912 of file model.h.

#define MR_DEPRECATED_NORMAL   (0)

Definition at line 892 of file model.h.

#define MR_DEPRECATED_SHOW_INVISIBLE_FACES   (1<<15)

Definition at line 908 of file model.h.

#define MR_DEPRECATED_SHOW_OUTLINE   (1<<0)

Definition at line 893 of file model.h.

#define MR_DEPRECATED_SHOW_OUTLINE_HTL   (1<<26)

Definition at line 919 of file model.h.

#define MR_DEPRECATED_SHOW_OUTLINE_PRESET   (1<<14)

Definition at line 907 of file model.h.

#define MR_DEPRECATED_SHOW_PATHS   (1<<2)

Definition at line 895 of file model.h.

#define MR_DEPRECATED_SHOW_PIVOTS   (1<<1)

Definition at line 894 of file model.h.

#define MR_DEPRECATED_SHOW_RADIUS   (1<<3)

Definition at line 896 of file model.h.

#define MR_DEPRECATED_SHOW_SHIELDS   (1<<4)

Definition at line 897 of file model.h.

#define MR_DEPRECATED_SHOW_THRUSTERS   (1<<5)

Definition at line 898 of file model.h.

#define MR_DESATURATED   (1<<2)

Definition at line 861 of file model.h.

#define MR_EDGE_ALPHA   (1<<23)

Definition at line 882 of file model.h.

#define MR_EMPTY_SLOT0   (1<<3)

Definition at line 862 of file model.h.

#define MR_EMPTY_SLOT1   (1<<4)

Definition at line 863 of file model.h.

#define MR_EMPTY_SLOT2   (1<<6)

Definition at line 865 of file model.h.

#define MR_EMPTY_SLOT3   (1<<17)

Definition at line 876 of file model.h.

#define MR_EMPTY_SLOT4   (1<<21)

Definition at line 880 of file model.h.

#define MR_EMPTY_SLOT5   (1<<30)

Definition at line 889 of file model.h.

#define MR_FORCE_CLAMP   (1<<29)

Definition at line 888 of file model.h.

#define MR_FULL_DETAIL   (1<<28)

Definition at line 887 of file model.h.

#define MR_IS_ASTEROID   (1<<12)

Definition at line 871 of file model.h.

#define MR_IS_MISSILE   (1<<13)

Definition at line 872 of file model.h.

#define MR_NO_BATCH   (1<<22)

Definition at line 881 of file model.h.

#define MR_NO_CORRECT   (1<<10)

Definition at line 869 of file model.h.

#define MR_NO_CULL   (1<<20)

Definition at line 879 of file model.h.

#define MR_NO_FOGGING   (1<<25)

Definition at line 884 of file model.h.

#define MR_NO_GLOWMAPS   (1<<27)

Definition at line 886 of file model.h.

#define MR_NO_LIGHTING   (1<<8)

Definition at line 867 of file model.h.

#define MR_NO_POLYS   (1<<7)

Definition at line 866 of file model.h.

#define MR_NO_SMOOTHING   (1<<11)

Definition at line 870 of file model.h.

#define MR_NO_TEXTURING   (1<<9)

Definition at line 868 of file model.h.

#define MR_NO_ZBUFFER   (1<<19)

Definition at line 878 of file model.h.

#define MR_NORMAL   (0)

Definition at line 858 of file model.h.

#define MR_SHOW_INVISIBLE_FACES   (1<<15)

Definition at line 874 of file model.h.

#define MR_SHOW_OUTLINE   (1<<0)

Definition at line 859 of file model.h.

#define MR_SHOW_OUTLINE_HTL   (1<<26)

Definition at line 885 of file model.h.

#define MR_SHOW_OUTLINE_PRESET   (1<<14)

Definition at line 873 of file model.h.

#define MR_SHOW_THRUSTERS   (1<<5)

Definition at line 864 of file model.h.

#define MR_SKYBOX   (1<<1)

Definition at line 860 of file model.h.

#define MSS_FLAG2_AUTOREPAIR_IF_DISABLED   (1 << 6)

Definition at line 144 of file model.h.

#define MSS_FLAG2_COLLIDE_SUBMODEL   (1 << 3)

Definition at line 141 of file model.h.

#define MSS_FLAG2_DESTROYED_ROTATION   (1 << 4)

Definition at line 142 of file model.h.

#define MSS_FLAG2_NO_AUTOREPAIR_IF_DISABLED   (1 << 7)

Definition at line 145 of file model.h.

#define MSS_FLAG2_NO_DISAPPEAR   (1 << 2)

Definition at line 140 of file model.h.

#define MSS_FLAG2_PLAYER_TURRET_SOUND   (1 << 0)

Definition at line 138 of file model.h.

#define MSS_FLAG2_SHARE_FIRE_DIRECTION   (1 << 8)

Definition at line 146 of file model.h.

#define MSS_FLAG2_TURRET_ONLY_TARGET_IF_CAN_FIRE   (1 << 1)

Definition at line 139 of file model.h.

#define MSS_FLAG2_TURRET_USE_AMMO   (1 << 5)

Definition at line 143 of file model.h.

#define MSS_FLAG_AI_ROTATE   (1 << 2)

Definition at line 108 of file model.h.

#define MSS_FLAG_ALLOW_LANDING   (1 << 20)

Definition at line 126 of file model.h.

#define MSS_FLAG_ALLOW_VANISHING   (1 << 26)

Definition at line 132 of file model.h.

#define MSS_FLAG_ARTILLERY   (1 << 6)

Definition at line 112 of file model.h.

#define MSS_FLAG_AWACS   (1 << 5)

Definition at line 111 of file model.h.

#define MSS_FLAG_CARRY_NO_DAMAGE   (1 << 9)

Definition at line 115 of file model.h.

#define MSS_FLAG_CARRY_SHOCKWAVE   (1 << 19)

Definition at line 125 of file model.h.

#define MSS_FLAG_CREWPOINT   (1 << 3)

Definition at line 109 of file model.h.

#define MSS_FLAG_DAMAGE_AS_HULL   (1 << 27)

Definition at line 133 of file model.h.

#define MSS_FLAG_FIRE_ON_NORMAL   (1 << 11)

Definition at line 117 of file model.h.

#define MSS_FLAG_FIRE_ON_TARGET   (1 << 15)

Definition at line 121 of file model.h.

#define MSS_FLAG_FOV_EDGE_CHECK   (1 << 21)

Definition at line 127 of file model.h.

#define MSS_FLAG_FOV_REQUIRED   (1 << 22)

Definition at line 128 of file model.h.

#define MSS_FLAG_IGNORE_IF_DEAD   (1 << 25)

Definition at line 131 of file model.h.

#define MSS_FLAG_NO_AGGREGATE   (1 << 29)

Definition at line 135 of file model.h.

#define MSS_FLAG_NO_LIVE_DEBRIS   (1 << 24)

Definition at line 130 of file model.h.

#define MSS_FLAG_NO_REPLACE   (1 << 23)

Definition at line 129 of file model.h.

#define MSS_FLAG_NO_SS_TARGETING   (1 << 16)

Definition at line 122 of file model.h.

#define MSS_FLAG_ROTATES   (1 << 0)

Definition at line 106 of file model.h.

#define MSS_FLAG_STEPPED_ROTATE   (1 << 1)

Definition at line 107 of file model.h.

#define MSS_FLAG_TRIGGERED   (1 << 7)

Definition at line 113 of file model.h.

#define MSS_FLAG_TURRET_ALT_MATH   (1 << 18)

Definition at line 124 of file model.h.

#define MSS_FLAG_TURRET_ANIM_WAIT   (1 << 30)

Definition at line 136 of file model.h.

#define MSS_FLAG_TURRET_FIXED_FP   (1 << 13)

Definition at line 119 of file model.h.

#define MSS_FLAG_TURRET_HULL_CHECK   (1 << 12)

Definition at line 118 of file model.h.

#define MSS_FLAG_TURRET_LOCKED   (1 << 28)

Definition at line 134 of file model.h.

#define MSS_FLAG_TURRET_MATRIX   (1 << 4)

Definition at line 110 of file model.h.

#define MSS_FLAG_TURRET_RESET_IDLE   (1 << 17)

Definition at line 123 of file model.h.

#define MSS_FLAG_TURRET_SALVO   (1 << 14)

Definition at line 120 of file model.h.

#define MSS_FLAG_UNTARGETABLE   (1 << 8)

Definition at line 114 of file model.h.

#define MSS_FLAG_USE_MULTIPLE_GUNS   (1 << 10)

Definition at line 116 of file model.h.

#define MSS_MODEL_FLAG2_MASK   0

Definition at line 152 of file model.h.

Definition at line 151 of file model.h.

#define NUM_SUBSYSTEM_FLAGS   33

Definition at line 148 of file model.h.

#define PM_FLAG_ALLOW_TILING   (1<<0)

Definition at line 620 of file model.h.

#define PM_FLAG_AUTOCEN   (1<<1)

Definition at line 621 of file model.h.

#define PM_FLAG_BATCHED   (1<<3)

Definition at line 623 of file model.h.

#define PM_FLAG_HAS_INTRINSIC_ROTATE   (1<<4)

Definition at line 624 of file model.h.

#define PM_FLAG_TRANS_BUFFER   (1<<2)

Definition at line 622 of file model.h.

#define PULSE_COS   2

Definition at line 456 of file model.h.

#define PULSE_SHIFTTRI   4

Definition at line 458 of file model.h.

#define PULSE_SIN   1

Definition at line 455 of file model.h.

#define PULSE_TRI   3

Definition at line 457 of file model.h.

#define REPLACE_WITH_INVISIBLE   -47

Definition at line 693 of file model.h.

#define SUBSYSTEM_ACTIVATION   10

Definition at line 62 of file model.h.

#define SUBSYSTEM_COMMUNICATION   5

Definition at line 57 of file model.h.

#define SUBSYSTEM_ENGINE   1

Definition at line 53 of file model.h.

#define SUBSYSTEM_GAS_COLLECT   9

Definition at line 61 of file model.h.

#define SUBSYSTEM_MAX   12

Definition at line 64 of file model.h.

#define SUBSYSTEM_NAVIGATION   4

Definition at line 56 of file model.h.

#define SUBSYSTEM_NONE   0

Definition at line 52 of file model.h.

#define SUBSYSTEM_RADAR   3

Definition at line 55 of file model.h.

#define SUBSYSTEM_SENSORS   7

Definition at line 59 of file model.h.

#define SUBSYSTEM_SOLAR   8

Definition at line 60 of file model.h.

#define SUBSYSTEM_TURRET   2

Definition at line 54 of file model.h.

#define SUBSYSTEM_UNKNOWN   11

Definition at line 63 of file model.h.

#define SUBSYSTEM_WEAPONS   6

Definition at line 58 of file model.h.

#define TM_BASE_TYPE   0

Definition at line 657 of file model.h.

#define TM_GLOW_TYPE   1

Definition at line 658 of file model.h.

#define TM_HEIGHT_TYPE   4

Definition at line 661 of file model.h.

#define TM_MISC_TYPE   5

Definition at line 662 of file model.h.

#define TM_NORMAL_TYPE   3

Definition at line 660 of file model.h.

#define TM_NUM_TYPES   6

Definition at line 663 of file model.h.

#define TM_SPECULAR_TYPE   2

Definition at line 659 of file model.h.

Typedef Documentation

typedef struct bsp_light bsp_light
typedef struct cross_section cross_section
typedef struct dock_bay dock_bay
typedef struct eye eye
typedef struct insignia insignia
typedef struct mc_info mc_info
typedef struct model_octant model_octant
typedef struct model_path model_path
typedef struct model_special model_special
typedef struct mp_vert mp_vert
typedef struct mst_info mst_info
typedef struct shield_info shield_info
typedef struct shield_tri shield_tri
typedef struct shield_vertex shield_vertex
typedef struct ship_bay ship_bay_t
typedef struct thruster_bank thruster_bank
typedef struct w_bank w_bank

Function Documentation

void find_submodel_instance_point ( vec3d outpnt,
int  model_instance_num,
int  submodel_num 
)

Finds the current location of a submodel (in the ship's frame of reference), taking into account the rotations of any parent submodels it might have.

Parameters
*outpntOutput point
model_instance_numIndex into Polygon_model_instances
submodel_numThe number of the submodel we're interested in

Definition at line 4258 of file modelread.cpp.

void find_submodel_instance_point_normal ( vec3d outpnt,
vec3d outnorm,
int  model_instance_num,
int  submodel_num,
const vec3d submodel_pnt,
const vec3d submodel_norm 
)

Finds the current location and rotation (in the ship's frame of reference) of a submodel point, taking into account the rotations of the submodel and any parent submodels it might have.

Parameters
*outpntOutput point
*outnormOutput normal
model_instance_numIndex into Polygon_model_instances
submodel_numThe number of the submodel we're interested in
*submodel_pntThe point which's current position we want, in the submodel's frame of reference
*submodel_normThe normal which's current direction we want, in the ship's frame of reference

Definition at line 4302 of file modelread.cpp.

void find_submodel_instance_point_orient ( vec3d outpnt,
matrix outorient,
int  model_instance_num,
int  submodel_num,
const vec3d submodel_pnt,
const matrix submodel_orient 
)

Same as find_submodel_instance_point_normal, except that this takes and returns matrices instead of normals.

Finds the current location and rotation (in the ship's frame of reference) of a submodel point, taking into account the rotations of the submodel and any parent submodels it might have.

Parameters
*outpntOutput point
*outorientOutput matrix
model_instance_numIndex into Polygon_model_instances
submodel_numThe number of the submodel we're interested in
*submodel_pntThe point which's current position we want, in the submodel's frame of reference
*submodel_orientThe local matrix which's current orientation in the ship's frame of reference we want

Definition at line 4370 of file modelread.cpp.

void find_submodel_instance_world_point ( vec3d outpnt,
int  model_instance_num,
int  submodel_num,
const matrix objorient,
const vec3d objpos 
)

Finds the current world location of a submodel, taking into account the rotations of any parent submodels it might have.

Parameters
*outpntOutput point
model_instance_numIndex into Polygon_model_instances
submodel_numThe number of the submodel we're interested in

Definition at line 4431 of file modelread.cpp.

SCP_vector<glow_point_bank_override>::iterator get_glowpoint_bank_override_by_name ( const char *  name)

Definition at line 5550 of file modelread.cpp.

float get_world_closest_box_point_with_delta ( vec3d closest_box_point,
object box_obj,
vec3d start_point,
int is_inside,
float  delta 
)

Definition at line 3935 of file modelinterp.cpp.

void glowpoint_init ( )

Definition at line 5779 of file modelread.cpp.

void interp_render_arc ( vec3d v1,
vec3d v2,
color primary,
color secondary,
float  arc_width 
)

Definition at line 1502 of file modelinterp.cpp.

void mc_info_init ( mc_info mc)
inline

Definition at line 1138 of file model.h.

void model_add_arc ( int  model_num,
int  sub_model_num,
vec3d v1,
vec3d v2,
int  arc_type 
)

Definition at line 5003 of file modelread.cpp.

void model_clear_instance ( int  model_num)

Definition at line 4624 of file modelread.cpp.

void model_clear_instance_info ( submodel_instance_info sii)

Definition at line 4669 of file modelread.cpp.

void model_clear_submodel_instance ( submodel_instance sm_instance,
bsp_info sm 
)

Definition at line 4684 of file modelread.cpp.

void model_clear_submodel_instances ( int  model_instance_num)

Definition at line 4696 of file modelread.cpp.

int model_collide ( mc_info mc_info_obj)

Definition at line 1230 of file modelcollide.cpp.

void model_collide_parse_bsp ( bsp_collision_tree tree,
void model_ptr,
int  version 
)

Definition at line 731 of file modelcollide.cpp.

void model_collide_preprocess ( matrix orient,
int  model_instance_num,
int  detail = 0 
)

Definition at line 1392 of file modelcollide.cpp.

void model_copy_subsystems ( int  n_subsystems,
model_subsystem d_sp,
model_subsystem s_sp 
)

Definition at line 505 of file modelread.cpp.

int model_create_bsp_collision_tree ( )

Definition at line 5162 of file modelread.cpp.

int model_create_instance ( bool  is_ship,
int  model_num 
)

Definition at line 2855 of file modelread.cpp.

void model_delete_instance ( int  model_instance_num)

Definition at line 2907 of file modelread.cpp.

void model_do_intrinsic_rotations ( int  model_instance_num = -1)

Definition at line 4878 of file modelread.cpp.

void model_do_look_at ( int  model_num)

Definition at line 4927 of file modelread.cpp.

void model_draw_bay_paths ( int  model_num)

Docking bay and fighter bay paths

Definition at line 1423 of file modelinterp.cpp.

void model_draw_bay_paths_htl ( int  model_num)

Docking bay and fighter bay paths

Definition at line 1378 of file modelinterp.cpp.

void model_draw_debug_points ( polymodel pm,
bsp_info submodel,
uint  flags 
)

Definition at line 1194 of file modelinterp.cpp.

void model_draw_paths ( int  model_num,
uint  flags 
)

Debug code to show all the paths of a model

Definition at line 1273 of file modelinterp.cpp.

void model_draw_paths_htl ( int  model_num,
uint  flags 
)

Debug code to show all the paths of a model

Definition at line 1324 of file modelinterp.cpp.

int model_find_2d_bound ( int  model_num,
matrix orient,
vec3d pos,
int x1,
int y1,
int x2,
int y2 
)

Find 2D bound for model

Note that x1,y1,x2,y2 aren't clipped to 2D screen coordinates.

Returns
zero if x1,y1,x2,y2 are valid
2 for point offscreen

Definition at line 3301 of file modelread.cpp.

int model_find_2d_bound_min ( int  model_num,
matrix orient,
vec3d pos,
int x1,
int y1,
int x2,
int y2 
)

Definition at line 3168 of file modelread.cpp.

int model_find_bay_path ( int  modelnum,
char *  bay_path_name 
)

Definition at line 5142 of file modelread.cpp.

float model_find_closest_point ( vec3d outpnt,
int  model_num,
int  submodel_num,
matrix orient,
vec3d pos,
vec3d eye_pos 
)

Definition at line 2197 of file modelinterp.cpp.

int model_find_dock_index ( int  modelnum,
int  dock_type,
int  index_to_start_at = 0 
)

Definition at line 5031 of file modelread.cpp.

int model_find_dock_name_index ( int  modelnum,
char *  name 
)

Definition at line 5055 of file modelread.cpp.

void model_find_obj_dir ( vec3d w_vec,
vec3d m_vec,
int  model_instance_num,
int  submodel_num,
matrix objorient 
)

Definition at line 3383 of file modelread.cpp.

void model_find_submodel_offset ( vec3d outpnt,
int  model_num,
int  sub_model_num 
)

Definition at line 4041 of file modelread.cpp.

int model_find_texture ( int  model_num,
int  bitmap 
)

See if the given texture is used by the passed model. 0 if not used, 1 if used, -1 on error

Definition at line 3854 of file modelinterp.cpp.

void model_find_world_dir ( vec3d out_dir,
vec3d in_dir,
int  model_num,
int  submodel_num,
const matrix objorient 
)

Definition at line 4551 of file modelread.cpp.

void model_find_world_point ( vec3d outpnt,
vec3d mpnt,
int  model_num,
int  submodel_num,
const matrix objorient,
const vec3d objpos 
)

Definition at line 4099 of file modelread.cpp.

void model_finish_cloak ( int  full_cloak)

Definition at line 382 of file modelinterp.cpp.

void model_free_all ( )

Definition at line 337 of file modelread.cpp.

polymodel* model_get ( int  model_num)

Definition at line 3134 of file modelread.cpp.

bsp_collision_tree* model_get_bsp_collision_tree ( int  tree_index)

Definition at line 5189 of file modelread.cpp.

float model_get_core_radius ( int  modelnum)

Definition at line 3114 of file modelread.cpp.

int model_get_dock_index_type ( int  modelnum,
int  index 
)

Definition at line 5120 of file modelread.cpp.

char* model_get_dock_name ( int  modelnum,
int  index 
)

Definition at line 5103 of file modelread.cpp.

int model_get_dock_types ( int  modelnum)

Definition at line 5128 of file modelread.cpp.

polymodel_instance* model_get_instance ( int  model_instance_num)

Definition at line 3154 of file modelread.cpp.

int model_get_num_dock_points ( int  modelnum)

Definition at line 5112 of file modelread.cpp.

float model_get_radius ( int  modelnum)

Definition at line 3105 of file modelread.cpp.

void model_get_rotating_submodel_list ( SCP_vector< int > *  submodel_vector,
object objp 
)

Definition at line 4468 of file modelread.cpp.

void model_get_submodel_tree_list ( SCP_vector< int > &  submodel_vector,
polymodel pm,
int  mn 
)

Definition at line 4533 of file modelread.cpp.

bool model_get_team_color ( team_color clr,
const SCP_string team,
const SCP_string secondaryteam,
fix  timestamp,
int  fadetime 
)

Definition at line 5179 of file modelinterp.cpp.

void model_init ( )

Definition at line 409 of file modelread.cpp.

void model_init_submodel_axis_pt ( submodel_instance_info sii,
int  model_num,
int  submodel_num 
)

Definition at line 4936 of file modelread.cpp.

void model_instance_find_obj_dir ( vec3d w_vec,
vec3d m_vec,
int  model_instance_num,
int  submodel_num,
matrix objorient 
)

Definition at line 3416 of file modelread.cpp.

void model_instance_find_world_dir ( vec3d out_dir,
vec3d in_dir,
int  model_instance_num,
int  submodel_num,
const matrix objorient 
)

Definition at line 4587 of file modelread.cpp.

void model_instance_find_world_point ( vec3d outpnt,
vec3d mpnt,
int  model_instance_num,
int  submodel_num,
const matrix objorient,
const vec3d objpos 
)

Definition at line 4135 of file modelread.cpp.

void model_instance_free_all ( )

Definition at line 355 of file modelread.cpp.

void model_interp_set_animated_effect_and_timer ( int  effect_num = 0,
float  effect_timer = 0.0f 
)

Definition at line 5240 of file modelinterp.cpp.

void model_interp_set_clip_plane ( vec3d pos = NULL,
vec3d normal = NULL 
)

Definition at line 5227 of file modelinterp.cpp.

void model_interp_set_team_color ( const SCP_string team,
const SCP_string secondaryteam,
fix  timestamp,
int  fadetime 
)

Definition at line 5221 of file modelinterp.cpp.

int model_load ( char *  filename,
int  n_subsystems,
model_subsystem subsystems,
int  ferror = 1,
int  duplicate = 0 
)

Definition at line 2573 of file modelread.cpp.

void model_load_texture ( polymodel pm,
int  i,
char *  file 
)

Definition at line 2412 of file modelread.cpp.

void model_make_turret_matrix ( int  model_num,
model_subsystem turret 
)

Definition at line 3846 of file modelread.cpp.

void model_page_in_textures ( int  modelnum,
int  ship_info_index 
)

Given a newly loaded model, page in all textures

Definition at line 3967 of file modelinterp.cpp.

void model_page_out_textures ( int  model_num,
bool  release = false 
)

Definition at line 3993 of file modelinterp.cpp.

void model_remove_bsp_collision_tree ( int  tree_index)

Definition at line 5197 of file modelread.cpp.

void model_render_DEPRECATED ( int  model_num,
matrix orient,
vec3d pos,
uint  flags = MR_DEPRECATED_NORMAL,
int  objnum = -1,
int  lighting_skip = -1,
int replacement_textures = NULL,
int  render = MODEL_RENDER_ALL,
const bool  is_skybox = false 
)

Definition at line 2006 of file modelinterp.cpp.

void model_render_insignias ( polymodel pm,
int  detail_level,
int  bitmap_num 
)

Definition at line 1841 of file modelinterp.cpp.

void model_render_shields ( polymodel pm,
uint  flags 
)

Definition at line 1804 of file modelinterp.cpp.

int model_rotate_gun ( int  model_num,
model_subsystem turret,
matrix orient,
angles base_angles,
angles gun_angles,
vec3d pos,
vec3d dst,
int  obj_idx,
bool  reset = false 
)

Definition at line 3904 of file modelread.cpp.

void model_set_alpha ( float  alpha)

Set model transparency for use with MR_ALL_XPARENT

Definition at line 3846 of file modelinterp.cpp.

void model_set_detail_level ( int  n)

Definition at line 3692 of file modelinterp.cpp.

void model_set_forced_texture ( int  bmap)

Set the forces bitmap

Definition at line 3838 of file modelinterp.cpp.

void model_set_insignia_bitmap ( int  bmap)

Set the insignia bitmap to be used when rendering a ship with an insignia (-1 switches it off altogether)

Definition at line 3825 of file modelinterp.cpp.

void model_set_instance ( int  model_num,
int  sub_model_num,
submodel_instance_info sii,
int  flags = 0 
)

Definition at line 4726 of file modelread.cpp.

void model_set_instance_info ( submodel_instance_info sii,
float  turn_rate,
float  turn_accel 
)

Definition at line 4708 of file modelread.cpp.

void model_set_instance_techroom ( int  model_num,
int  sub_model_num,
float  angle_1,
float  angle_2 
)

Definition at line 4772 of file modelread.cpp.

void model_set_outline_color ( int  r,
int  g,
int  b 
)

Definition at line 3677 of file modelinterp.cpp.

void model_set_outline_color_fast ( void outline_color)

Definition at line 3685 of file modelinterp.cpp.

void model_set_replacement_textures ( int replacement_textures)

Definition at line 3830 of file modelinterp.cpp.

void model_set_thrust ( int  model_num,
mst_info mst 
)

Scales the engines thrusters by this much

Definition at line 437 of file modelinterp.cpp.

void model_set_warp_globals ( float  scale_x = 1.0f,
float  scale_y = 1.0f,
float  scale_z = 1.0f,
int  bitmap_id = -1,
float  alpha = -1.0f 
)

Definition at line 5158 of file modelinterp.cpp.

void model_setup_cloak ( vec3d shift,
int  full_cloak,
int  alpha 
)

Definition at line 358 of file modelinterp.cpp.

int model_should_render_engine_glow ( int  objnum,
int  bank_obj 
)

Definition at line 5084 of file modelinterp.cpp.

void model_show_damaged ( int  model_num,
int  show_damaged 
)

Definition at line 3790 of file modelinterp.cpp.

void model_unload ( int  modelnum,
int  force = 0 
)

Definition at line 162 of file modelread.cpp.

void model_update_instance ( int  model_instance_num,
int  sub_model_num,
submodel_instance_info sii,
int  flags 
)

Definition at line 4796 of file modelread.cpp.

int model_which_octant ( vec3d pnt,
int  model_num,
matrix model_orient,
vec3d model_pos,
model_octant **  oct 
)

Definition at line 468 of file modeloctant.cpp.

int model_which_octant_distant ( vec3d pnt,
int  model_num,
matrix model_orient,
vec3d model_pos,
model_octant **  oct 
)

Definition at line 429 of file modeloctant.cpp.

void moldel_calc_facing_pts ( vec3d top,
vec3d bot,
vec3d fvec,
vec3d pos,
float  w,
float  z_add,
vec3d Eyeposition 
)

Definition at line 2230 of file modelinterp.cpp.

void parse_triggersint ( int n_trig,
queued_animation **  triggers,
char *  props 
)
int submodel_find_2d_bound_min ( int  model_num,
int  submodel,
matrix orient,
vec3d pos,
int x1,
int y1,
int x2,
int y2 
)

Definition at line 3232 of file modelread.cpp.

int submodel_get_num_polys ( int  model_num,
int  submodel_num 
)

Returns number of tmaps & flat polys in a submodel

Definition at line 3778 of file modelinterp.cpp.

int submodel_get_num_verts ( int  model_num,
int  submodel_num 
)

Returns number of verts in a submodel;

Definition at line 3700 of file modelinterp.cpp.

int submodel_get_points ( int  model_num,
int  submodel_num,
int  max_num,
vec3d **  nts 
)
float submodel_get_radius ( int  modelnum,
int  submodelnum 
)

Definition at line 3123 of file modelread.cpp.

void submodel_get_two_random_points ( int  model_num,
int  submodel_num,
vec3d v1,
vec3d v2,
vec3d n1,
vec3d n2 
)

Gets two random points on a model

Definition at line 3583 of file modelinterp.cpp.

void submodel_get_two_random_points_better ( int  model_num,
int  submodel_num,
vec3d v1,
vec3d v2 
)

Definition at line 3631 of file modelinterp.cpp.

void submodel_render_DEPRECATED ( int  model_num,
int  submodel_num,
matrix orient,
vec3d pos,
uint  flags = MR_DEPRECATED_NORMAL,
int  objnum = -1,
int replacement_textures = NULL,
int  render = MODEL_RENDER_ALL 
)

Definition at line 3343 of file modelinterp.cpp.

void submodel_rotate ( model_subsystem psub,
submodel_instance_info sii 
)

Definition at line 3688 of file modelread.cpp.

void submodel_rotate ( bsp_info sm,
submodel_instance_info sii 
)

Definition at line 3704 of file modelread.cpp.

void submodel_stepped_rotate ( model_subsystem psub,
submodel_instance_info sii 
)

Definition at line 3474 of file modelread.cpp.

int subobj_find_2d_bound ( float  radius,
matrix orient,
vec3d pos,
int x1,
int y1,
int x2,
int y2 
)

Find 2D bound for sub object

Note that x1,y1,x2,y2 aren't clipped to 2D screen coordinates.

Returns
zero if x1,y1,x2,y2 are valid
2 for point offscreen

Definition at line 3345 of file modelread.cpp.

void world_find_model_instance_point ( vec3d out,
vec3d world_pt,
const polymodel_instance pmi,
int  submodel_num,
const matrix orient,
const vec3d pos 
)

Definition at line 4215 of file modelread.cpp.

void world_find_model_point ( vec3d out,
vec3d world_pt,
const polymodel pm,
int  submodel_num,
const matrix orient,
const vec3d pos 
)

Definition at line 4182 of file modelread.cpp.

Variable Documentation

flag_def_list Dock_type_names[]

Definition at line 115 of file modelread.cpp.

SCP_vector<glow_point_bank_override> glowpoint_bank_overrides

Definition at line 124 of file modelread.cpp.

flag_def_list model_render_flags[]

Definition at line 40 of file modelread.cpp.

int model_render_flags_size

Definition at line 50 of file modelread.cpp.

int modelstats_num_polys

Definition at line 45 of file modelinterp.cpp.

int modelstats_num_polys_drawn

Definition at line 46 of file modelinterp.cpp.

int modelstats_num_sortnorms

Definition at line 48 of file modelinterp.cpp.

int modelstats_num_verts

Definition at line 47 of file modelinterp.cpp.

int Num_dock_type_names

Definition at line 122 of file modelread.cpp.

char* Subsystem_types[SUBSYSTEM_MAX]

Definition at line 95 of file modelread.cpp.