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

Function ObjSetAABB

Descent3/object.cpp:1653–1677  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1651}
1652
1653void ObjSetAABB(object *obj) {
1654 vector object_rad;
1655
1656 if (obj->type == OBJ_ROOM) {
1657 obj->min_xyz = Rooms[obj->id].min_xyz;
1658 obj->max_xyz = Rooms[obj->id].max_xyz;
1659 } else if (obj->flags & OF_POLYGON_OBJECT && obj->type != OBJ_WEAPON && obj->type != OBJ_DEBRIS &&
1660 obj->type != OBJ_POWERUP && obj->type != OBJ_PLAYER) {
1661 vector offset_pos;
1662
1663 object_rad.x = object_rad.y = object_rad.z = Poly_models[obj->rtype.pobj_info.model_num].anim_size;
1664 offset_pos = obj->pos + obj->anim_sphere_offset;
1665
1666 obj->min_xyz = offset_pos - object_rad;
1667 obj->max_xyz = offset_pos + object_rad;
1668 } else {
1669 object_rad.x = obj->size;
1670 object_rad.y = obj->size;
1671 object_rad.z = obj->size;
1672
1673 obj->min_xyz = obj->pos - object_rad;
1674
1675 obj->max_xyz = obj->pos + object_rad;
1676 }
1677}
1678
1679//-----------------------------------------------------------------------------
1680// initialize a new object. adds to the list for the given room

Callers 8

do_physics_simFunction · 0.85
ProcessTestKeysFunction · 0.85
CreateRoomObjectsFunction · 0.85
LGSObjectsFunction · 0.85
ReadObjectFunction · 0.85
ComputeAABBFunction · 0.85
ObjCreateFunction · 0.85
ObjSetPosFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected