sets the orientation of an object. This should be called to orient an object
| 3136 | |
| 3137 | // sets the orientation of an object. This should be called to orient an object |
| 3138 | void 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 |
| 3162 | void ObjSetPos(object *obj, vector *pos, int roomnum, matrix *orient, bool f_update_attached_children) { |
no test coverage detected