FS2_Open
Open source remastering of the Freespace 2 engine
|
#include <string.h>
#include <ctype.h>
#include "asteroid/asteroid.h"
#include "bmpman/bmpman.h"
#include "cfile/cfile.h"
#include "cmdline/cmdline.h"
#include "freespace2/freespace.h"
#include "gamesnd/gamesnd.h"
#include "globalincs/linklist.h"
#include "io/key.h"
#include "io/timer.h"
#include "math/fvi.h"
#include "math/vecmat.h"
#include "model/model.h"
#include "model/modelsinc.h"
#include "parse/parselo.h"
#include "render/3dinternal.h"
#include "ship/ship.h"
#include "weapon/weapon.h"
Go to the source code of this file.
Classes | |
class | submodel_intrinsic_rotation |
class | intrinsic_rotation |
Macros | |
#define | MODEL_LIB |
#define | MAX_SUBMODEL_COLLISION_ROT_ANGLE (PI / 6.0f) |
#define | PM_COMPATIBLE_VERSION 1900 |
#define | PM_OBJFILE_MAJOR_VERSION 30 |
Variables | |
flag_def_list | model_render_flags [] |
int | model_render_flags_size = sizeof(model_render_flags)/sizeof(flag_def_list) |
polymodel * | Polygon_models [MAX_POLYGON_MODELS] |
SCP_vector< polymodel_instance * > | Polygon_model_instances |
SCP_vector< bsp_collision_tree > | Bsp_collision_tree_list |
int | Cmdline_nohtl |
CFILE * | ss_fp = NULL |
char | model_filename [_MAX_PATH] |
char | debug_name [_MAX_PATH] |
int | ss_warning_shown = 0 |
int | Model_ram = 0 |
char * | Subsystem_types [SUBSYSTEM_MAX] |
flag_def_list | Dock_type_names [] |
int | Num_dock_type_names = sizeof(Dock_type_names) / sizeof(flag_def_list) |
SCP_vector< glow_point_bank_override > | glowpoint_bank_overrides |
SCP_vector< intrinsic_rotation > | Intrinsic_rotations |
#define MAX_SUBMODEL_COLLISION_ROT_ANGLE (PI / 6.0f) |
Definition at line 52 of file modelread.cpp.
#define MODEL_LIB |
Definition at line 20 of file modelread.cpp.
#define PM_COMPATIBLE_VERSION 1900 |
Definition at line 75 of file modelread.cpp.
#define PM_OBJFILE_MAJOR_VERSION 30 |
Definition at line 80 of file modelread.cpp.
Definition at line 830 of file modelread.cpp.
Definition at line 851 of file modelread.cpp.
void do_new_subsystem | ( | int | n_subsystems, |
model_subsystem * | slist, | ||
int | subobj_num, | ||
float | rad, | ||
vec3d * | pnt, | ||
char * | props, | ||
char * | subobj_name, | ||
int | model_num | ||
) |
Definition at line 723 of file modelread.cpp.
Definition at line 824 of file modelread.cpp.
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.
*outpnt | Output point |
model_instance_num | Index into Polygon_model_instances |
submodel_num | The 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.
*outpnt | Output point |
*outnorm | Output normal |
model_instance_num | Index into Polygon_model_instances |
submodel_num | The number of the submodel we're interested in |
*submodel_pnt | The point which's current position we want, in the submodel's frame of reference |
*submodel_norm | The 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.
*outpnt | Output point |
*outorient | Output matrix |
model_instance_num | Index into Polygon_model_instances |
submodel_num | The number of the submodel we're interested in |
*submodel_pnt | The point which's current position we want, in the submodel's frame of reference |
*submodel_orient | The 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.
*outpnt | Output point |
model_instance_num | Index into Polygon_model_instances |
submodel_num | The 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_submodel_delta_angle | ( | submodel_instance_info * | sii | ) |
Definition at line 707 of file modelread.cpp.
void get_user_prop_value | ( | char * | buf, |
char * | value | ||
) |
Definition at line 431 of file modelread.cpp.
void glowpoint_init | ( | ) |
Definition at line 5779 of file modelread.cpp.
void glowpoint_override_defaults | ( | glow_point_bank_override * | gpo | ) |
Definition at line 5516 of file modelread.cpp.
Definition at line 4333 of file modelinterp.cpp.
Definition at line 4577 of file modelinterp.cpp.
Definition at line 4601 of file modelinterp.cpp.
Definition at line 4311 of file modelinterp.cpp.
Definition at line 4057 of file modelread.cpp.
Definition at line 933 of file modelread.cpp.
Definition at line 5003 of file modelread.cpp.
Definition at line 1009 of file modelread.cpp.
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.
Definition at line 4696 of file modelread.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.
Definition at line 2855 of file modelread.cpp.
Definition at line 2907 of file modelread.cpp.
Definition at line 4916 of file modelread.cpp.
Definition at line 4878 of file modelread.cpp.
void model_do_intrinsic_rotations_sub | ( | intrinsic_rotation * | ir | ) |
Definition at line 4847 of file modelread.cpp.
Definition at line 4927 of file modelread.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.
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.
Definition at line 5142 of file modelread.cpp.
Definition at line 5031 of file modelread.cpp.
Definition at line 5055 of file modelread.cpp.
void model_find_obj_dir | ( | vec3d * | w_vec, |
vec3d * | m_vec, | ||
int | model_num, | ||
int | submodel_num, | ||
matrix * | objorient | ||
) |
Definition at line 3383 of file modelread.cpp.
Definition at line 4041 of file modelread.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_free_all | ( | ) |
Definition at line 337 of file modelread.cpp.
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.
Definition at line 3114 of file modelread.cpp.
Definition at line 5120 of file modelread.cpp.
Definition at line 5103 of file modelread.cpp.
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.
Definition at line 5112 of file modelread.cpp.
Definition at line 3068 of file modelread.cpp.
Definition at line 3105 of file modelread.cpp.
void model_get_rotating_submodel_axis | ( | vec3d * | model_axis, |
vec3d * | world_axis, | ||
int | model_instance_num, | ||
int | submodel_num, | ||
matrix * | objorient | ||
) |
Definition at line 3452 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.
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.
int model_load | ( | char * | filename, |
int | n_subsystems, | ||
model_subsystem * | subsystems, | ||
int | ferror, | ||
int | duplicate | ||
) |
Definition at line 2573 of file modelread.cpp.
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.
Definition at line 2934 of file modelread.cpp.
void model_page_in_start | ( | ) |
Definition at line 373 of file modelread.cpp.
void model_page_in_stop | ( | ) |
Definition at line 390 of file modelread.cpp.
Definition at line 5197 of file modelread.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 | ||
) |
Definition at line 3904 of file modelread.cpp.
Definition at line 3004 of file modelread.cpp.
void model_set_instance | ( | int | model_num, |
int | sub_model_num, | ||
submodel_instance_info * | sii, | ||
int | flags | ||
) |
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.
Definition at line 4772 of file modelread.cpp.
void model_set_subsys_path_nums | ( | polymodel * | pm, |
int | n_subsystems, | ||
model_subsystem * | subsystems | ||
) |
Definition at line 2972 of file modelread.cpp.
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.
void parse_glowpoint_table | ( | const char * | filename | ) |
Definition at line 5561 of file modelread.cpp.
void parse_triggers | ( | int & | n_trig, |
queued_animation ** | triggers, | ||
char * | props | ||
) |
Definition at line 794 of file modelread.cpp.
Definition at line 451 of file modelread.cpp.
int prop_string | ( | char * | props, |
char ** | p, | ||
const char * | option0 | ||
) |
Definition at line 488 of file modelread.cpp.
int prop_string | ( | char * | props, |
char ** | p, | ||
const char * | option0, | ||
const char * | option1 | ||
) |
Definition at line 492 of file modelread.cpp.
int prop_string | ( | char * | props, |
char ** | p, | ||
const char * | option0, | ||
const char * | option1, | ||
const char * | option2 | ||
) |
Definition at line 496 of file modelread.cpp.
int read_model_file | ( | polymodel * | pm, |
char * | filename, | ||
int | n_subsystems, | ||
model_subsystem * | subsystems, | ||
int | ferror | ||
) |
mprintf(( "Detail level %d is model %d.\n", i, pm->detail[i] ));
Definition at line 1028 of file modelread.cpp.
Definition at line 4442 of file modelread.cpp.
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.
Definition at line 3123 of file modelread.cpp.
Definition at line 3580 of file modelread.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.
Definition at line 3345 of file modelread.cpp.
Definition at line 5415 of file modelread.cpp.
Definition at line 5222 of file modelread.cpp.
Definition at line 5315 of file modelread.cpp.
Definition at line 5370 of file modelread.cpp.
Definition at line 5255 of file modelread.cpp.
Definition at line 5471 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.
void world_find_real_model_point | ( | vec3d * | out, |
vec3d * | world_pt, | ||
polymodel * | pm, | ||
int | submodel_num, | ||
matrix * | orient, | ||
vec3d * | pos | ||
) |
Definition at line 4077 of file modelread.cpp.
SCP_vector<bsp_collision_tree> Bsp_collision_tree_list |
Definition at line 59 of file modelread.cpp.
int Cmdline_nohtl |
Definition at line 438 of file cmdline.cpp.
char debug_name[_MAX_PATH] |
Definition at line 67 of file modelread.cpp.
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.
SCP_vector<intrinsic_rotation> Intrinsic_rotations |
Definition at line 157 of file modelread.cpp.
char model_filename[_MAX_PATH] |
Definition at line 66 of file modelread.cpp.
int Model_ram = 0 |
Definition at line 69 of file modelread.cpp.
flag_def_list model_render_flags[] |
Definition at line 40 of file modelread.cpp.
int model_render_flags_size = sizeof(model_render_flags)/sizeof(flag_def_list) |
Definition at line 50 of file modelread.cpp.
int Num_dock_type_names = sizeof(Dock_type_names) / sizeof(flag_def_list) |
Definition at line 122 of file modelread.cpp.
SCP_vector<polymodel_instance*> Polygon_model_instances |
Definition at line 57 of file modelread.cpp.
polymodel* Polygon_models[MAX_POLYGON_MODELS] |
Definition at line 56 of file modelread.cpp.
CFILE* ss_fp = NULL |
Definition at line 65 of file modelread.cpp.
int ss_warning_shown = 0 |
Definition at line 68 of file modelread.cpp.
char* Subsystem_types[SUBSYSTEM_MAX] |
Definition at line 95 of file modelread.cpp.