MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / ObjSetOrient

Function ObjSetOrient

Descent3/object.cpp:3138–3159  ·  view source on GitHub ↗

sets the orientation of an object. This should be called to orient an object

Source from the content-addressed store, hash-verified

3136
3137// sets the orientation of an object. This should be called to orient an object
3138void ObjSetOrient(object *obj, const matrix *orient) {
3139 // Accounts for if the orientation was set and then this function is being used
3140 // to update the other stuff
3141 if (&obj->orient != orient)
3142 obj->orient = *orient;
3143
3144 // Recompute the orientation dependant information
3145 if (obj->flags & OF_POLYGON_OBJECT) {
3146 if (obj->type != OBJ_WEAPON && obj->type != OBJ_DEBRIS && obj->type != OBJ_POWERUP && obj->type != OBJ_ROOM) {
3147 matrix m;
3148
3149 m = obj->orient;
3150 vm_TransposeMatrix(&m);
3151
3152 obj->wall_sphere_offset = Poly_models[obj->rtype.pobj_info.model_num].wall_size_offset * m;
3153 obj->anim_sphere_offset = Poly_models[obj->rtype.pobj_info.model_num].anim_size_offset * m;
3154 } else {
3155 obj->wall_sphere_offset = Zero_vector;
3156 obj->anim_sphere_offset = Zero_vector;
3157 }
3158 }
3159}
3160
3161// sets the position of an object. This should be called to move an object
3162void ObjSetPos(object *obj, vector *pos, int roomnum, matrix *orient, bool f_update_attached_children) {

Callers 15

do_physics_simFunction · 0.85
do_walking_simFunction · 0.85
HObjectPlaceFunction · 0.85
HObjectSetDefaultFunction · 0.85
RotateObjectFunction · 0.85
RenderMethod · 0.85
CreateNewViewerFunction · 0.85
ResetRoomViewerFunction · 0.85
ObjectPasteFunction · 0.85
get_axis_valueMethod · 0.85

Calls 1

vm_TransposeMatrixFunction · 0.50

Tested by

no test coverage detected