Skip to content

Commit 487f769

Browse files
committed
Renaming vm_copy_transpose_matrix to vm_copy_transpose
1 parent 7604e82 commit 487f769

File tree

13 files changed

+37
-38
lines changed

13 files changed

+37
-38
lines changed

code/ai/aicode.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9261,7 +9261,7 @@ float dock_orient_and_approach(object *docker_objp, int docker_index, object *do
92619261
vec3d origin_docker_point, adjusted_docker_point, v_offset;
92629262

92639263
// find out the rotation matrix that will get us from the old to the new rotation
9264-
vm_copy_transpose_matrix(&temp, &docker_objp->orient);
9264+
vm_copy_transpose(&temp, &docker_objp->orient);
92659265
vm_matrix_x_matrix(&m_offset, &temp, &dom);
92669266

92679267
// now find out the new docker point after being adjusted for the new orientation

code/fred2/fredrender.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,7 +1659,7 @@ void game_do_frame()
16591659
leader = &Objects[cur_object_index];
16601660
leader_old_pos = leader->pos; // save original position
16611661
leader_orient = leader->orient; // save original orientation
1662-
vm_copy_transpose_matrix(&leader_transpose, &leader_orient);
1662+
vm_copy_transpose(&leader_transpose, &leader_orient);
16631663

16641664
process_controls(&leader->pos, &leader->orient, f2fl(Frametime), key);
16651665
vm_vec_sub(&delta_pos, &leader->pos, &leader_old_pos); // get position change
@@ -1676,7 +1676,7 @@ void game_do_frame()
16761676

16771677
// change rotation matrix to rotate in opposite direction. This rotation
16781678
// matrix is what the leader ship has rotated by.
1679-
vm_copy_transpose_matrix(&rot_trans, &view_physics.last_rotmat);
1679+
vm_copy_transpose(&rot_trans, &view_physics.last_rotmat);
16801680

16811681
// get point relative to our point of rotation (make POR the origin). Since
16821682
// only the leader has been moved yet, and not the objects, we have to use

code/fred2/fredview.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ int drag_rotate_objects()
773773

774774
leader = &Objects[cur_object_index];
775775
leader_orient = leader->orient; // save original orientation
776-
vm_copy_transpose_matrix(&leader_transpose, &leader_orient);
776+
vm_copy_transpose(&leader_transpose, &leader_orient);
777777

778778
vm_angles_2_matrix(&rotmat, &a);
779779
vm_matrix_x_matrix(&newmat, &leader->orient, &rotmat);
@@ -789,7 +789,7 @@ int drag_rotate_objects()
789789

790790
// change rotation matrix to rotate in opposite direction. This rotation
791791
// matrix is what the leader ship has rotated by.
792-
vm_copy_transpose_matrix(&rot_trans, &rotmat);
792+
vm_copy_transpose(&rot_trans, &rotmat);
793793

794794
// get point relative to our point of rotation (make POR the origin).
795795
vm_vec_sub(&tmpv1, &objp->pos, &leader->pos);

code/hud/hudreticle.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ void HudGaugeReticle::getFirepointStatus() {
328328

329329
matrix eye_orient, player_transpose;
330330

331-
vm_copy_transpose_matrix(&player_transpose, &Objects[Player->objnum].orient);
331+
vm_copy_transpose(&player_transpose, &Objects[Player->objnum].orient);
332332
vm_matrix_x_matrix(&eye_orient, &player_transpose, &Eye_matrix);
333333
vm_vec_rotate(&fpfromeye, &pm->gun_banks[i].pnt[j], &eye_orient);
334334

code/math/vecmat.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ vec3d *vm_vec_rotate(vec3d *dest, const vec3d *src, const matrix *m)
943943
//returns ptr to dest vector
944944
//dest CANNOT equal source
945945
// This is a faster replacement for this common code sequence:
946-
// vm_copy_transpose_matrix(&tempm,src_matrix);
946+
// vm_copy_transpose(&tempm,src_matrix);
947947
// vm_vec_rotate(dst_vec,src_vect,&tempm);
948948
// Replace with:
949949
// vm_vec_unrotate(dst_vec,src_vect, src_matrix)
@@ -979,7 +979,7 @@ matrix *vm_transpose(matrix *m)
979979

980980
//copy and transpose a matrix. returns ptr to matrix
981981
//dest CANNOT equal source. use vm_transpose() if this is the case
982-
matrix *vm_copy_transpose_matrix(matrix *dest, const matrix *src)
982+
matrix *vm_copy_transpose(matrix *dest, const matrix *src)
983983
{
984984
Assert(dest != src);
985985

@@ -1866,7 +1866,7 @@ void vm_matrix_interpolate(const matrix *goal_orient, const matrix *curr_orient,
18661866

18671867
// FIND ROTATION NEEDED FOR GOAL
18681868
// goal_orient = R curr_orient, so R = goal_orient curr_orient^-1
1869-
vm_copy_transpose_matrix(&Mtemp1, curr_orient); // Mtemp1 = curr ^-1
1869+
vm_copy_transpose(&Mtemp1, curr_orient); // Mtemp1 = curr ^-1
18701870
vm_matrix_x_matrix(&rot_matrix, &Mtemp1, goal_orient); // R = goal * Mtemp1
18711871
vm_orthogonalize_matrix(&rot_matrix);
18721872
vm_matrix_to_rot_axis_and_angle(&rot_matrix, &theta, &rot_axis); // determines angle and rotation axis from curr to goal
@@ -2008,7 +2008,7 @@ void get_camera_limits(const matrix *start_camera, const matrix *end_camera, flo
20082008
vec3d angle;
20092009

20102010
// determine the necessary rotation matrix
2011-
vm_copy_transpose_matrix(&temp, start_camera);
2011+
vm_copy_transpose(&temp, start_camera);
20122012
vm_matrix_x_matrix(&rot_matrix, &temp, end_camera);
20132013
vm_orthogonalize_matrix(&rot_matrix);
20142014

@@ -2378,7 +2378,7 @@ void vm_estimate_next_orientation(const matrix *last_orient, const matrix *curre
23782378

23792379
matrix Mtemp;
23802380
matrix Rot_matrix;
2381-
vm_copy_transpose_matrix(&Mtemp, last_orient); // Mtemp = (L)^-1
2381+
vm_copy_transpose(&Mtemp, last_orient); // Mtemp = (L)^-1
23822382
vm_matrix_x_matrix(&Rot_matrix, &Mtemp, current_orient); // R = C Mtemp1
23832383
vm_matrix_x_matrix(next_orient, current_orient, &Rot_matrix);
23842384
}

code/math/vecmat.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ vec3d *vm_vec_rotate(vec3d *dest, const vec3d *src, const matrix *m);
253253
//returns ptr to dest vector
254254
//dest CANNOT equal source
255255
// This is a faster replacement for this common code sequence:
256-
// vm_copy_transpose_matrix(&tempm,src_matrix);
256+
// vm_copy_transpose(&tempm,src_matrix);
257257
// vm_vec_rotate(dst_vec,src_vect,&tempm);
258258
// Replace with:
259259
// vm_vec_unrotate(dst_vec,src_vect, src_matrix)
@@ -268,8 +268,7 @@ matrix *vm_transpose(matrix *m);
268268

269269
//copy and transpose a matrix. returns ptr to matrix
270270
//dest CANNOT equal source. use vm_transpose() if this is the case
271-
matrix *vm_copy_transpose_matrix(matrix *dest, const matrix *src);
272-
#define vm_copy_transpose(dest,src) vm_copy_transpose_matrix((dest),(src))
271+
matrix *vm_copy_transpose(matrix *dest, const matrix *src);
273272

274273
//mulitply 2 matrices, fill in dest. returns ptr to dest
275274
//dest CANNOT equal either source

code/model/modelcollide.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,7 @@ void mc_check_subobj( int mn )
12061206
vm_rotate_matrix_by_angles(&rotation_matrix, &angs);
12071207

12081208
matrix inv_orientation;
1209-
vm_copy_transpose_matrix(&inv_orientation, &csm->orientation);
1209+
vm_copy_transpose(&inv_orientation, &csm->orientation);
12101210

12111211
vm_matrix_x_matrix(&tm, &rotation_matrix, &inv_orientation);
12121212
}
@@ -1376,7 +1376,7 @@ void model_collide_preprocess_subobj(vec3d *pos, matrix *orient, polymodel *pm,
13761376
vm_rotate_matrix_by_angles(&rotation_matrix, &angs);
13771377

13781378
matrix inv_orientation;
1379-
vm_copy_transpose_matrix(&inv_orientation, &csm->orientation);
1379+
vm_copy_transpose(&inv_orientation, &csm->orientation);
13801380

13811381
vm_matrix_x_matrix(&tm, &rotation_matrix, &inv_orientation);
13821382
}

code/model/modelinterp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1628,7 +1628,7 @@ void model_interp_subcall(polymodel * pm, int mn, int detail_level)
16281628
vm_rotate_matrix_by_angles(&rotation_matrix, &pm->submodel[mn].angs);
16291629

16301630
matrix inv_orientation;
1631-
vm_copy_transpose_matrix(&inv_orientation, &pm->submodel[mn].orientation);
1631+
vm_copy_transpose(&inv_orientation, &pm->submodel[mn].orientation);
16321632

16331633
matrix submodel_matrix;
16341634
vm_matrix_x_matrix(&submodel_matrix, &rotation_matrix, &inv_orientation);
@@ -4771,7 +4771,7 @@ void model_render_children_buffers_DEPRECATED(polymodel *pm, int mn, int detail_
47714771
vm_rotate_matrix_by_angles(&rotation_matrix, &ang);
47724772

47734773
matrix inv_orientation;
4774-
vm_copy_transpose_matrix(&inv_orientation, &model->orientation);
4774+
vm_copy_transpose(&inv_orientation, &model->orientation);
47754775

47764776
matrix submodel_matrix;
47774777
vm_matrix_x_matrix(&submodel_matrix, &rotation_matrix, &inv_orientation);

code/model/modelread.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3235,7 +3235,7 @@ void model_find_obj_dir(vec3d *w_vec, vec3d *m_vec, object *pship_obj, int sub_m
32353235
vm_rotate_matrix_by_angles(&rotation_matrix, &pm->submodel[mn].angs);
32363236

32373237
matrix inv_orientation;
3238-
vm_copy_transpose_matrix(&inv_orientation, &pm->submodel[mn].orientation);
3238+
vm_copy_transpose(&inv_orientation, &pm->submodel[mn].orientation);
32393239

32403240
vm_matrix_x_matrix(&m, &rotation_matrix, &inv_orientation);
32413241

@@ -3271,7 +3271,7 @@ void model_instance_find_obj_dir(vec3d *w_vec, vec3d *m_vec, object *pship_obj,
32713271
vm_rotate_matrix_by_angles(&rotation_matrix, &pmi->submodel[mn].angs);
32723272

32733273
matrix inv_orientation;
3274-
vm_copy_transpose_matrix(&inv_orientation, &pm->submodel[mn].orientation);
3274+
vm_copy_transpose(&inv_orientation, &pm->submodel[mn].orientation);
32753275

32763276
vm_matrix_x_matrix(&m, &rotation_matrix, &inv_orientation);
32773277

@@ -3307,7 +3307,7 @@ void model_rot_sub_into_obj(vec3d * outpnt, vec3d *mpnt,polymodel *pm, int sub_m
33073307
vm_rotate_matrix_by_angles(&rotation_matrix, &pm->submodel[mn].angs);
33083308

33093309
matrix inv_orientation;
3310-
vm_copy_transpose_matrix(&inv_orientation, &pm->submodel[mn].orientation);
3310+
vm_copy_transpose(&inv_orientation, &pm->submodel[mn].orientation);
33113311

33123312
vm_matrix_x_matrix(&m, &rotation_matrix, &inv_orientation);
33133313

@@ -3933,7 +3933,7 @@ void make_submodel_world_matrix(polymodel *pm, int sn, vec3d*v){
39333933
vm_angles_2_matrix(&a, &pm->submodel[sn].angs);
39343934
if (!IS_MAT_NULL(&pm->submodel[sn].orientation)) {
39353935
matrix inv, f;
3936-
vm_copy_transpose_matrix(&inv, &pm->submodel[sn].orientation);
3936+
vm_copy_transpose(&inv, &pm->submodel[sn].orientation);
39373937
vm_matrix_x_matrix(&f, &a, &inv);
39383938
vm_matrix_x_matrix(&a, &pm->submodel[sn].orientation, &f);
39393939
}
@@ -3983,7 +3983,7 @@ void model_find_world_point(vec3d * outpnt, vec3d *mpnt,int model_num,int sub_mo
39833983
vm_rotate_matrix_by_angles(&rotation_matrix, &pm->submodel[mn].angs);
39843984

39853985
matrix inv_orientation;
3986-
vm_copy_transpose_matrix(&inv_orientation, &pm->submodel[mn].orientation);
3986+
vm_copy_transpose(&inv_orientation, &pm->submodel[mn].orientation);
39873987

39883988
vm_matrix_x_matrix(&m, &rotation_matrix, &inv_orientation);
39893989

@@ -4020,7 +4020,7 @@ void model_instance_find_world_point(vec3d * outpnt, vec3d *mpnt, int model_num,
40204020
vm_rotate_matrix_by_angles(&rotation_matrix, &pmi->submodel[mn].angs);
40214021

40224022
matrix inv_orientation;
4023-
vm_copy_transpose_matrix(&inv_orientation, &pm->submodel[mn].orientation);
4023+
vm_copy_transpose(&inv_orientation, &pm->submodel[mn].orientation);
40244024

40254025
vm_matrix_x_matrix(&m, &rotation_matrix, &inv_orientation);
40264026

@@ -4072,7 +4072,7 @@ void world_find_model_point(vec3d *out, vec3d *world_pt, polymodel *pm, int subm
40724072
vm_rotate_matrix_by_angles(&rotation_matrix, &pm->submodel[submodel_num].angs);
40734073

40744074
matrix inv_orientation;
4075-
vm_copy_transpose_matrix(&inv_orientation, &pm->submodel[submodel_num].orientation);
4075+
vm_copy_transpose(&inv_orientation, &pm->submodel[submodel_num].orientation);
40764076

40774077
vm_matrix_x_matrix(&m, &rotation_matrix, &inv_orientation);
40784078

@@ -4105,7 +4105,7 @@ void world_find_model_instance_point(vec3d *out, vec3d *world_pt, polymodel *pm,
41054105
vm_rotate_matrix_by_angles(&rotation_matrix, &pmi->submodel[submodel_num].angs);
41064106

41074107
matrix inv_orientation;
4108-
vm_copy_transpose_matrix(&inv_orientation, &pm->submodel[submodel_num].orientation);
4108+
vm_copy_transpose(&inv_orientation, &pm->submodel[submodel_num].orientation);
41094109

41104110
vm_matrix_x_matrix(&m, &rotation_matrix, &inv_orientation);
41114111

@@ -4140,7 +4140,7 @@ void find_submodel_instance_point(vec3d *outpnt, object *pship_obj, int submodel
41404140
rotation_matrix = pm->submodel[parent_mn].orientation;
41414141
vm_rotate_matrix_by_angles(&rotation_matrix, &pmi->submodel[parent_mn].angs);
41424142

4143-
vm_copy_transpose_matrix(&inv_orientation, &pm->submodel[parent_mn].orientation);
4143+
vm_copy_transpose(&inv_orientation, &pm->submodel[parent_mn].orientation);
41444144

41454145
vm_matrix_x_matrix(&submodel_instance_matrix, &rotation_matrix, &inv_orientation);
41464146

@@ -4187,7 +4187,7 @@ void find_submodel_instance_point_normal(vec3d *outpnt, vec3d *outnorm, object *
41874187
rotation_matrix = pm->submodel[submodel_num].orientation;
41884188
vm_rotate_matrix_by_angles(&rotation_matrix, &pmi->submodel[submodel_num].angs);
41894189

4190-
vm_copy_transpose_matrix(&inv_orientation, &pm->submodel[submodel_num].orientation);
4190+
vm_copy_transpose(&inv_orientation, &pm->submodel[submodel_num].orientation);
41914191

41924192
vm_matrix_x_matrix(&submodel_instance_matrix, &rotation_matrix, &inv_orientation);
41934193

@@ -4205,7 +4205,7 @@ void find_submodel_instance_point_normal(vec3d *outpnt, vec3d *outnorm, object *
42054205
rotation_matrix = pm->submodel[parent_model_num].orientation;
42064206
vm_rotate_matrix_by_angles(&rotation_matrix, &pmi->submodel[parent_model_num].angs);
42074207

4208-
vm_copy_transpose_matrix(&inv_orientation, &pm->submodel[parent_model_num].orientation);
4208+
vm_copy_transpose(&inv_orientation, &pm->submodel[parent_model_num].orientation);
42094209

42104210
vm_matrix_x_matrix(&submodel_instance_matrix, &rotation_matrix, &inv_orientation);
42114211

@@ -4257,7 +4257,7 @@ void find_submodel_instance_point_orient(vec3d *outpnt, matrix *outorient, objec
42574257
rotation_matrix = pm->submodel[submodel_num].orientation;
42584258
vm_rotate_matrix_by_angles(&rotation_matrix, &pmi->submodel[submodel_num].angs);
42594259

4260-
vm_copy_transpose_matrix(&inv_orientation, &pm->submodel[submodel_num].orientation);
4260+
vm_copy_transpose(&inv_orientation, &pm->submodel[submodel_num].orientation);
42614261

42624262
vm_matrix_x_matrix(&submodel_instance_matrix, &rotation_matrix, &inv_orientation);
42634263

@@ -4275,7 +4275,7 @@ void find_submodel_instance_point_orient(vec3d *outpnt, matrix *outorient, objec
42754275
rotation_matrix = pm->submodel[parent_model_num].orientation;
42764276
vm_rotate_matrix_by_angles(&rotation_matrix, &pmi->submodel[parent_model_num].angs);
42774277

4278-
vm_copy_transpose_matrix(&inv_orientation, &pm->submodel[parent_model_num].orientation);
4278+
vm_copy_transpose(&inv_orientation, &pm->submodel[parent_model_num].orientation);
42794279

42804280
vm_matrix_x_matrix(&submodel_instance_matrix, &rotation_matrix, &inv_orientation);
42814281

@@ -4431,7 +4431,7 @@ void model_find_world_dir(vec3d * out_dir, vec3d *in_dir,int model_num, int sub_
44314431
vm_rotate_matrix_by_angles(&rotation_matrix, &pm->submodel[mn].angs);
44324432

44334433
matrix inv_orientation;
4434-
vm_copy_transpose_matrix(&inv_orientation, &pm->submodel[mn].orientation);
4434+
vm_copy_transpose(&inv_orientation, &pm->submodel[mn].orientation);
44354435

44364436
vm_matrix_x_matrix(&m, &rotation_matrix, &inv_orientation);
44374437

@@ -4468,7 +4468,7 @@ void model_instance_find_world_dir(vec3d * out_dir, vec3d *in_dir,int model_num,
44684468
vm_rotate_matrix_by_angles(&rotation_matrix, &pmi->submodel[mn].angs);
44694469

44704470
matrix inv_orientation;
4471-
vm_copy_transpose_matrix(&inv_orientation, &pm->submodel[mn].orientation);
4471+
vm_copy_transpose(&inv_orientation, &pm->submodel[mn].orientation);
44724472

44734473
vm_matrix_x_matrix(&m, &rotation_matrix, &inv_orientation);
44744474

code/model/modelrender.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,7 +1450,7 @@ void model_render_children_buffers(draw_list* scene, model_render_params* interp
14501450
vm_rotate_matrix_by_angles(&rotation_matrix, &ang);
14511451

14521452
matrix inv_orientation;
1453-
vm_copy_transpose_matrix(&inv_orientation, &model->orientation);
1453+
vm_copy_transpose(&inv_orientation, &model->orientation);
14541454

14551455
matrix submodel_matrix;
14561456
vm_matrix_x_matrix(&submodel_matrix, &rotation_matrix, &inv_orientation);
@@ -2530,7 +2530,7 @@ void model_render_debug_children(polymodel *pm, int mn, int detail_level, uint d
25302530
vm_rotate_matrix_by_angles(&rotation_matrix, &ang);
25312531

25322532
matrix inv_orientation;
2533-
vm_copy_transpose_matrix(&inv_orientation, &model->orientation);
2533+
vm_copy_transpose(&inv_orientation, &model->orientation);
25342534

25352535
matrix submodel_matrix;
25362536
vm_matrix_x_matrix(&submodel_matrix, &rotation_matrix, &inv_orientation);

0 commit comments

Comments
 (0)