Skip to content

Commit 4e9f5dc

Browse files
committed
Merge pull request #531 from Goober5000/intrinsic_rotation_refactor
refactor of dumb_rotation to intrinsic_rotation
2 parents 617fd6a + df41bbe commit 4e9f5dc

File tree

10 files changed

+71
-75
lines changed

10 files changed

+71
-75
lines changed

code/asteroid/asteroid.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ object *asteroid_create(asteroid_field *asfieldp, int asteroid_type, int asteroi
331331
asp->objnum = objnum;
332332
asp->model_instance_num = -1;
333333

334-
if (model_get(asip->model_num[asteroid_subtype])->flags & PM_FLAG_HAS_DUMB_ROTATE) {
334+
if (model_get(asip->model_num[asteroid_subtype])->flags & PM_FLAG_HAS_INTRINSIC_ROTATE) {
335335
asp->model_instance_num = model_create_instance(false, asip->model_num[asteroid_subtype]);
336336
}
337337

code/model/model.h

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ extern int model_render_flags_size;
3333
#define MOVEMENT_TYPE_POS 0
3434
#define MOVEMENT_TYPE_ROT 1
3535
#define MOVEMENT_TYPE_ROT_SPECIAL 2 // for turrets only
36-
#define MOVEMENT_TYPE_TRIGGERED 3 //triggered rotation
37-
#define MOVEMENT_TYPE_LOOK_AT 4 // the subobject is always looking at a 'look at' subobject, as best it can - Bobboau
38-
#define MOVEMENT_TYPE_DUMB_ROTATE 5
36+
#define MOVEMENT_TYPE_TRIGGERED 3 // triggered rotation
37+
#define MOVEMENT_TYPE_INTRINSIC_ROTATE 4 // intrinsic (non-subsystem-based) rotation
38+
#define MOVEMENT_TYPE_LOOK_AT 5 // the subobject is always looking at a 'look at' subobject, as best it can - Bobboau
3939

4040

4141
// DA 11/13/98 Reordered to account for difference between max and game
@@ -617,11 +617,11 @@ typedef struct insignia {
617617
vec3d norm[MAX_INS_VECS] ; //normal of the insignia-Bobboau
618618
} insignia;
619619

620-
#define PM_FLAG_ALLOW_TILING (1<<0) // Allow texture tiling
621-
#define PM_FLAG_AUTOCEN (1<<1) // contains autocentering info
622-
#define PM_FLAG_TRANS_BUFFER (1<<2) // render transparency buffer
623-
#define PM_FLAG_BATCHED (1<<3) // this model can be batch rendered
624-
#define PM_FLAG_HAS_DUMB_ROTATE (1<<4) // whether this model has a dumb-rotate submodel somewhere
620+
#define PM_FLAG_ALLOW_TILING (1<<0) // Allow texture tiling
621+
#define PM_FLAG_AUTOCEN (1<<1) // contains autocentering info
622+
#define PM_FLAG_TRANS_BUFFER (1<<2) // render transparency buffer
623+
#define PM_FLAG_BATCHED (1<<3) // this model can be batch rendered
624+
#define PM_FLAG_HAS_INTRINSIC_ROTATE (1<<4) // whether this model has an intrinsic rotation submodel somewhere
625625

626626
// Goober5000
627627
class texture_info
@@ -1058,7 +1058,6 @@ extern void model_set_instance(int model_num, int sub_model_num, submodel_instan
10581058
extern void model_set_instance_techroom(int model_num, int sub_model_num, float angle_1, float angle_2);
10591059

10601060
void model_update_instance(int model_instance_num, int sub_model_num, submodel_instance_info *sii, int flags);
1061-
void model_instance_dumb_rotation(int model_instance_num);
10621061

10631062
// Adds an electrical arcing effect to a submodel
10641063
void model_add_arc(int model_num, int sub_model_num, vec3d *v1, vec3d *v2, int arc_type);
@@ -1370,7 +1369,7 @@ void model_finish_cloak(int full_cloak);
13701369

13711370
void model_do_look_at(int model_num); //Bobboau
13721371

1373-
void model_do_dumb_rotations(int model_instance_num = -1);
1372+
void model_do_intrinsic_rotations(int model_instance_num = -1);
13741373

13751374
int model_should_render_engine_glow(int objnum, int bank_obj);
13761375

code/model/modelread.cpp

Lines changed: 47 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,13 @@ SCP_vector<glow_point_bank_override> glowpoint_bank_overrides;
127127
// Goober5000 - reimplementation of Bobboau's $dumb_rotation feature in a way that works with the rest of the model instance system
128128
// note: since these data types are only ever used in this file, they don't need to be in model.h
129129

130-
class submodel_dumb_rotation
130+
class submodel_intrinsic_rotation
131131
{
132132
public:
133133
int submodel_num;
134134
submodel_instance_info submodel_info_1;
135135

136-
submodel_dumb_rotation(int _submodel_num, float _turn_rate)
136+
submodel_intrinsic_rotation(int _submodel_num, float _turn_rate)
137137
: submodel_num(_submodel_num)
138138
{
139139
memset(&submodel_info_1, 0, sizeof(submodel_info_1));
@@ -142,19 +142,19 @@ class submodel_dumb_rotation
142142
}
143143
};
144144

145-
class dumb_rotation
145+
class intrinsic_rotation
146146
{
147147
public:
148148
bool is_ship;
149149
int model_instance_num;
150-
SCP_vector<submodel_dumb_rotation> list;
150+
SCP_vector<submodel_intrinsic_rotation> list;
151151

152-
dumb_rotation(bool _is_ship, int _model_instance_num)
152+
intrinsic_rotation(bool _is_ship, int _model_instance_num)
153153
: is_ship(_is_ship), model_instance_num(_model_instance_num), list()
154154
{}
155155
};
156156

157-
SCP_vector<dumb_rotation> Dumb_rotations;
157+
SCP_vector<intrinsic_rotation> Intrinsic_rotations;
158158

159159

160160
// Free up a model, getting rid of all its memory
@@ -955,10 +955,6 @@ int read_model_file(polymodel * pm, char *filename, int n_subsystems, model_subs
955955
int i,j;
956956
vec3d temp_vec;
957957

958-
// little test code i used in fred2
959-
//char pwd[128];
960-
//getcwd(pwd, 128);
961-
962958
fp = cfopen(filename,"rb");
963959

964960
if (!fp) {
@@ -1268,10 +1264,10 @@ int read_model_file(polymodel * pm, char *filename, int n_subsystems, model_subs
12681264

12691265
// note, this should come BEFORE do_new_subsystem() for proper error handling (to avoid both rotating and dumb-rotating submodel)
12701266
if ( ( p = strstr(props, "$dumb_rotate") ) != NULL ) {
1271-
pm->submodel[n].movement_type = MOVEMENT_TYPE_DUMB_ROTATE;
1272-
pm->submodel[n].dumb_turn_rate = (float)atof(p+13);
1267+
pm->submodel[n].movement_type = MOVEMENT_TYPE_INTRINSIC_ROTATE;
1268+
pm->flags |= PM_FLAG_HAS_INTRINSIC_ROTATE;
12731269

1274-
pm->flags |= PM_FLAG_HAS_DUMB_ROTATE;
1270+
pm->submodel[n].dumb_turn_rate = (float)atof(p + 13);
12751271
} else {
12761272
pm->submodel[n].dumb_turn_rate = 0.0f;
12771273
}
@@ -1311,8 +1307,8 @@ int read_model_file(polymodel * pm, char *filename, int n_subsystems, model_subs
13111307
if (pm->submodel[n].movement_type == MOVEMENT_TYPE_ROT) {
13121308
Warning(LOCATION, "Rotation without rotation axis defined on submodel '%s' of model '%s'!", pm->submodel[n].name, pm->filename);
13131309
}
1314-
else if (pm->submodel[n].movement_type == MOVEMENT_TYPE_DUMB_ROTATE) {
1315-
Warning(LOCATION, "Dumb rotation without rotation axis defined on submodel '%s' of model '%s'!", pm->submodel[n].name, pm->filename);
1310+
else if (pm->submodel[n].movement_type == MOVEMENT_TYPE_INTRINSIC_ROTATE) {
1311+
Warning(LOCATION, "Intrinsic rotation (e.g. dumb-rotate) without rotation axis defined on submodel '%s' of model '%s'!", pm->submodel[n].name, pm->filename);
13161312
}
13171313
}
13181314

@@ -2791,20 +2787,20 @@ int model_create_instance(bool is_ship, int model_num)
27912787
model_clear_submodel_instance( &pmi->submodel[i], &pm->submodel[i] );
27922788
}
27932789

2794-
// add dumb_rotate instances if this model is dumb-rotating
2795-
if (pm->flags & PM_FLAG_HAS_DUMB_ROTATE) {
2796-
dumb_rotation dumb_rot(is_ship, open_slot);
2790+
// add intrinsic_rotation instances if this model is intrinsic-rotating
2791+
if (pm->flags & PM_FLAG_HAS_INTRINSIC_ROTATE) {
2792+
intrinsic_rotation intrinsic_rotate(is_ship, open_slot);
27972793

27982794
for (i = 0; i < pm->n_models; i++) {
2799-
if (pm->submodel[i].movement_type == MOVEMENT_TYPE_DUMB_ROTATE) {
2800-
dumb_rot.list.push_back(submodel_dumb_rotation(i, pm->submodel[i].dumb_turn_rate));
2795+
if (pm->submodel[i].movement_type == MOVEMENT_TYPE_INTRINSIC_ROTATE) {
2796+
intrinsic_rotate.list.push_back(submodel_intrinsic_rotation(i, pm->submodel[i].dumb_turn_rate));
28012797
}
28022798
}
28032799

2804-
if (dumb_rot.list.empty()) {
2805-
Assertion(!dumb_rot.list.empty(), "This model has the HAS_DUMB_ROTATE flag; why doesn't it have a dumb-rotating submodel?");
2800+
if (intrinsic_rotate.list.empty()) {
2801+
Assertion(!intrinsic_rotate.list.empty(), "This model has the PM_FLAG_HAS_INTRINSIC_ROTATE flag; why doesn't it have an intrinsic-rotating submodel?");
28062802
} else {
2807-
Dumb_rotations.push_back(dumb_rot);
2803+
Intrinsic_rotations.push_back(intrinsic_rotate);
28082804
}
28092805
}
28102806

@@ -2827,10 +2823,10 @@ void model_delete_instance(int model_instance_num)
28272823

28282824
Polygon_model_instances[model_instance_num] = NULL;
28292825

2830-
// delete dumb rotations associated with this instance
2831-
for (auto dumb_it = Dumb_rotations.begin(); dumb_it != Dumb_rotations.end(); ++dumb_it) {
2832-
if (dumb_it->model_instance_num == model_instance_num) {
2833-
Dumb_rotations.erase(dumb_it);
2826+
// delete intrinsic rotations associated with this instance
2827+
for (auto intrinsic_it = Intrinsic_rotations.begin(); intrinsic_it != Intrinsic_rotations.end(); ++intrinsic_it) {
2828+
if (intrinsic_it->model_instance_num == model_instance_num) {
2829+
Intrinsic_rotations.erase(intrinsic_it);
28342830
break;
28352831
}
28362832
}
@@ -3401,7 +3397,7 @@ void model_get_rotating_submodel_axis(vec3d *model_axis, vec3d *world_axis, int
34013397
polymodel *pm = model_get(modelnum);
34023398

34033399
bsp_info *sm = &pm->submodel[submodel_num];
3404-
Assert(sm->movement_type == MOVEMENT_TYPE_ROT || sm->movement_type == MOVEMENT_TYPE_DUMB_ROTATE);
3400+
Assert(sm->movement_type == MOVEMENT_TYPE_ROT || sm->movement_type == MOVEMENT_TYPE_INTRINSIC_ROTATE);
34053401

34063402
if (sm->movement_axis == MOVEMENT_AXIS_X) {
34073403
vm_vec_make(model_axis, 1.0f, 0.0f, 0.0f);
@@ -4411,7 +4407,7 @@ int rotating_submodel_has_ship_subsys(int submodel, ship *shipp)
44114407

44124408
/*
44134409
* Get all submodel indexes that satisfy the following:
4414-
* 1) Have the rotating or dumb-rotating movement type
4410+
* 1) Have the rotating or intrinsic-rotating movement type
44154411
* 2) Are currently rotating (i.e. actually moving and not part of the superstructure due to being destroyed or replaced)
44164412
* 3) Are not rotating too far for collision detection (c.f. MAX_SUBMODEL_COLLISION_ROT_ANGLE)
44174413
*/
@@ -4459,8 +4455,8 @@ void model_get_rotating_submodel_list(SCP_vector<int> *submodel_vector, object *
44594455
// Don't check it or its children if it is destroyed or it is a replacement (non-moving)
44604456
if ( !child_submodel->blown_off && (child_submodel->i_replace == -1) && !child_submodel->no_collisions && !child_submodel->nocollide_this_only) {
44614457

4462-
// Only look for submodels that rotate or dumb-rotate
4463-
if (child_submodel->movement_type == MOVEMENT_TYPE_ROT || child_submodel->movement_type == MOVEMENT_TYPE_DUMB_ROTATE) {
4458+
// Only look for submodels that rotate or intrinsic-rotate
4459+
if (child_submodel->movement_type == MOVEMENT_TYPE_ROT || child_submodel->movement_type == MOVEMENT_TYPE_INTRINSIC_ROTATE) {
44644460

44654461
// check submodel rotation is less than max allowed.
44664462
submodel_instance_info *sii = pmi->submodel[i].sii;
@@ -4790,52 +4786,52 @@ void model_update_instance(int model_instance_num, int sub_model_num, submodel_i
47904786
}
47914787
}
47924788

4793-
void model_do_dumb_rotations_sub(dumb_rotation *dr)
4789+
void model_do_intrinsic_rotations_sub(intrinsic_rotation *ir)
47944790
{
4795-
polymodel_instance *pmi = model_get_instance(dr->model_instance_num);
4791+
polymodel_instance *pmi = model_get_instance(ir->model_instance_num);
47964792
Assert(pmi != nullptr);
47974793

47984794
// Handle all submodels which have $dumb_rotate
4799-
for (auto sub_it = dr->list.begin(); sub_it != dr->list.end(); ++sub_it)
4795+
for (auto submodel_it = ir->list.begin(); submodel_it != ir->list.end(); ++submodel_it)
48004796
{
48014797
polymodel *pm = model_get(pmi->model_num);
4802-
bsp_info *sm = &pm->submodel[sub_it->submodel_num];
4803-
Assert(pm != nullptr && sm != nullptr);
4798+
Assert(pm != nullptr);
4799+
bsp_info *sm = &pm->submodel[submodel_it->submodel_num];
48044800

48054801
// First, calculate the angles for the rotation
4806-
submodel_rotate(sm, &sub_it->submodel_info_1);
4802+
submodel_rotate(sm, &submodel_it->submodel_info_1);
48074803

48084804
// Now actually rotate the submodel instance
4809-
// (Since this is a dumb rotation, we have no associated subsystem, so pass 0 for subsystem flags.)
4810-
model_update_instance(dr->model_instance_num, sub_it->submodel_num, &sub_it->submodel_info_1, 0);
4805+
// (Since this is an intrinsic rotation, we have no associated subsystem, so pass 0 for subsystem flags.)
4806+
model_update_instance(ir->model_instance_num, submodel_it->submodel_num, &submodel_it->submodel_info_1, 0);
48114807
}
48124808
}
48134809

4814-
// Handle the $dumb_rotate rotations for either a) a single ship model; or b) all non-ship models. The reason for the two cases is that ship_model_update_instance will
4810+
// Handle the intrinsic rotations for either a) a single ship model; or b) all non-ship models. The reason for the two cases is that ship_model_update_instance will
48154811
// be called for each ship via obj_move_all_post, but we also need to handle non-ship models once obj_move_all_post exits. Since the two processes are almost identical,
48164812
// they are both handled here.
48174813
//
48184814
// This function is quite a bit different than Bobboau's old model_do_dumb_rotation function. Whereas Bobboau used the brute-force technique of navigating through
48194815
// each model hierarchy as it was rendered, this function should be seen as a version of obj_move_all_post, but for models rather than objects. In fact, the only reason
4820-
// for the special ship case is that the ship dumb rotations kind of need to be handled where all the other ship rotations are. (Unless you want inconsistent collisions
4816+
// for the special ship case is that the ship intrinsic rotations kind of need to be handled where all the other ship rotations are. (Unless you want inconsistent collisions
48214817
// or damage sparks that aren't attached to models.)
48224818
//
48234819
// -- Goober5000
4824-
void model_do_dumb_rotations(int model_instance_num)
4820+
void model_do_intrinsic_rotations(int model_instance_num)
48254821
{
48264822
// we are handling a specific ship
48274823
if (model_instance_num >= 0)
48284824
{
4829-
for (auto dumb_it = Dumb_rotations.begin(); dumb_it != Dumb_rotations.end(); ++dumb_it)
4825+
for (auto intrinsic_it = Intrinsic_rotations.begin(); intrinsic_it != Intrinsic_rotations.end(); ++intrinsic_it)
48304826
{
4831-
if (dumb_it->model_instance_num == model_instance_num)
4827+
if (intrinsic_it->model_instance_num == model_instance_num)
48324828
{
4833-
Assertion(dumb_it->is_ship, "This code path is only for ship dumb_rotations! See the comments associated with the model_do_dumb_rotations function!");
4829+
Assertion(intrinsic_it->is_ship, "This code path is only for ship rotations! See the comments associated with the model_do_intrinsic_rotations function!");
48344830

48354831
// we're just doing one ship, and in ship_model_update_instance, that ship's angles were already set to zero
48364832

48374833
// Now update the angles in the submodels
4838-
model_do_dumb_rotations_sub(&(*dumb_it));
4834+
model_do_intrinsic_rotations_sub(&(*intrinsic_it));
48394835

48404836
// once we've handled this one ship, we're done
48414837
break;
@@ -4845,15 +4841,15 @@ void model_do_dumb_rotations(int model_instance_num)
48454841
// we are handling all non-ships
48464842
else
48474843
{
4848-
for (auto dumb_it = Dumb_rotations.begin(); dumb_it != Dumb_rotations.end(); ++dumb_it)
4844+
for (auto intrinsic_it = Intrinsic_rotations.begin(); intrinsic_it != Intrinsic_rotations.end(); ++intrinsic_it)
48494845
{
4850-
if (!dumb_it->is_ship)
4846+
if (!intrinsic_it->is_ship)
48514847
{
48524848
// Just as in ship_model_update_instance: first clear all the angles in the model to zero
4853-
model_clear_submodel_instances(dumb_it->model_instance_num);
4849+
model_clear_submodel_instances(intrinsic_it->model_instance_num);
48544850

48554851
// Now update the angles in the submodels
4856-
model_do_dumb_rotations_sub(&(*dumb_it));
4852+
model_do_intrinsic_rotations_sub(&(*intrinsic_it));
48574853
}
48584854
}
48594855
}
@@ -4886,7 +4882,7 @@ void model_init_submodel_axis_pt(submodel_instance_info *sii, int model_num, int
48864882
vec3d p1, v1, p2, v2, int1;
48874883

48884884
polymodel *pm = model_get(model_num);
4889-
Assert(pm->submodel[submodel_num].movement_type == MOVEMENT_TYPE_ROT || pm->submodel[submodel_num].movement_type == MOVEMENT_TYPE_DUMB_ROTATE);
4885+
Assert(pm->submodel[submodel_num].movement_type == MOVEMENT_TYPE_ROT || pm->submodel[submodel_num].movement_type == MOVEMENT_TYPE_INTRINSIC_ROTATE);
48904886
Assert(sii);
48914887

48924888
mpoint1 = NULL;

code/model/modelrender.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2731,13 +2731,13 @@ void model_render_queue(model_render_params *interp, draw_list *scene, int model
27312731
shipp = &Ships[objp->instance];
27322732
pmi = model_get_instance(shipp->model_instance_num);
27332733
}
2734-
else if (pm->flags & PM_FLAG_HAS_DUMB_ROTATE) {
2734+
else if (pm->flags & PM_FLAG_HAS_INTRINSIC_ROTATE) {
27352735
if (objp->type == OBJ_ASTEROID)
27362736
pmi = model_get_instance(Asteroids[objp->instance].model_instance_num);
27372737
else if (objp->type == OBJ_WEAPON)
27382738
pmi = model_get_instance(Weapons[objp->instance].model_instance_num);
27392739
else
2740-
Warning(LOCATION, "Unsupported object type %d for rendering dumb-rotate submodels!", objp->type);
2740+
Warning(LOCATION, "Unsupported object type %d for rendering intrinsic-rotate submodels!", objp->type);
27412741
}
27422742
}
27432743

code/object/object.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1454,10 +1454,10 @@ void obj_move_all(float frametime)
14541454
Script_system.RemHookVars(2, "User", "Target");
14551455
}
14561456

1457-
// Now that we've moved all the objects, move all the models that use dumb-rotate. We do that here because we already handled the
1457+
// Now that we've moved all the objects, move all the models that use intrinsic rotations. We do that here because we already handled the
14581458
// ship models in obj_move_all_post, and this is more or less conceptually close enough to move the rest. (Originally all models
1459-
// were dumb-rotated here, but there are collision-related reasons for ship rotations to happen where they do, even dumb ones.)
1460-
model_do_dumb_rotations();
1459+
// were intrinsic-rotated here, but for sequencing reasons, intrinsic ship rotations must happen along with regular ship rotations.)
1460+
model_do_intrinsic_rotations();
14611461

14621462
// After all objects have been moved, move all docked objects.
14631463
objp = GET_FIRST(&obj_used_list);

code/ship/ship.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13109,8 +13109,8 @@ void ship_model_update_instance(object *objp)
1310913109
}
1311013110
}
1311113111

13112-
// Handle dumb rotations for this ship
13113-
model_do_dumb_rotations(model_instance_num);
13112+
// Handle intrinsic rotations for this ship
13113+
model_do_intrinsic_rotations(model_instance_num);
1311413114

1311513115
// preprocess subobject orientations for collision detection
1311613116
model_collide_preprocess(&objp->orient, model_instance_num);

code/ship/shipfx.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ void shipfx_remove_submodel_ship_sparks(ship *shipp, int submodel_num)
7272
}
7373
}
7474

75+
void model_get_rotating_submodel_axis(vec3d *model_axis, vec3d *world_axis, int modelnum, int submodel_num, object *obj);
76+
7577
/**
7678
* Check if subsystem has live debris and create
7779
*
@@ -103,13 +105,12 @@ void shipfx_subsystem_maybe_create_live_debris(object *ship_objp, ship *ship_p,
103105
vec3d model_axis, world_axis, rotvel, world_axis_pt;
104106
matrix m_rot; // rotation for debris orient about axis
105107

106-
if(pm->submodel[submodel_num].movement_type == MOVEMENT_TYPE_ROT) {
108+
if (pm->submodel[submodel_num].movement_type == MOVEMENT_TYPE_ROT || pm->submodel[submodel_num].movement_type == MOVEMENT_TYPE_INTRINSIC_ROTATE) {
107109
if ( !sii->axis_set ) {
108110
model_init_submodel_axis_pt(sii, pm->id, submodel_num);
109111
}
110112

111113
// get the rotvel
112-
void model_get_rotating_submodel_axis(vec3d *model_axis, vec3d *world_axis, int modelnum, int submodel_num, object *obj);
113114
model_get_rotating_submodel_axis(&model_axis, &world_axis, pm->id, submodel_num, ship_objp);
114115
vm_vec_copy_scale(&rotvel, &world_axis, sii->cur_turn_rate);
115116

code/starfield/starfield.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2197,7 +2197,7 @@ void stars_set_background_model(char *model_name, char *texture_name, int flags)
21972197
if (Nmodel_num >= 0) {
21982198
model_page_in_textures(Nmodel_num);
21992199

2200-
if (model_get(Nmodel_num)->flags & PM_FLAG_HAS_DUMB_ROTATE) {
2200+
if (model_get(Nmodel_num)->flags & PM_FLAG_HAS_INTRINSIC_ROTATE) {
22012201
Nmodel_instance_num = model_create_instance(false, Nmodel_num);
22022202
}
22032203
}

code/weapon/weapon.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ extern int Num_weapon_subtypes;
163163
typedef struct weapon {
164164
int weapon_info_index; // index into weapon_info array
165165
int objnum; // object number for this weapon
166-
int model_instance_num; // model instance number, if we have any dumb-rotating submodels
166+
int model_instance_num; // model instance number, if we have any intrinsic-rotating submodels
167167
int team; // The team of the ship that fired this
168168
int species; // The species of the ship that fired thisz
169169
float lifeleft; // life left on this weapon

code/weapon/weapons.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5498,8 +5498,8 @@ int weapon_create( vec3d * pos, matrix * porient, int weapon_type, int parent_ob
54985498

54995499
objp->radius = model_get_radius(wip->model_num);
55005500

5501-
// if we dumb-rotate, make sure we have a model instance
5502-
if (model_get(wip->model_num)->flags & PM_FLAG_HAS_DUMB_ROTATE) {
5501+
// if we intrinsic-rotate, make sure we have a model instance
5502+
if (model_get(wip->model_num)->flags & PM_FLAG_HAS_INTRINSIC_ROTATE) {
55035503
wp->model_instance_num = model_create_instance(false, wip->model_num);
55045504
}
55055505
} else if ( wip->render_type == WRT_LASER ) {

0 commit comments

Comments
 (0)