MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / P_build_SimpleShell

Function P_build_SimpleShell

ogsr_engine/xrGame/PhysicsShell.cpp:164–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164CPhysicsShell* P_build_SimpleShell(CGameObject* obj, float mass, bool not_active_state)
165{
166 CPhysicsShell* pPhysicsShell = P_create_Shell();
167#ifdef DEBUG
168 pPhysicsShell->dbg_obj = smart_cast<CPhysicsShellHolder*>(obj);
169#endif
170 Fobb obb;
171 obj->Visual()->getVisData().box.get_CD(obb.m_translate, obb.m_halfsize);
172 obb.m_rotate.identity();
173 CPhysicsElement* E = P_create_Element();
174 R_ASSERT(E);
175 E->add_Box(obb);
176 pPhysicsShell->add_Element(E);
177 pPhysicsShell->setMass(mass);
178 pPhysicsShell->set_PhysicsRefObject(smart_cast<CPhysicsShellHolder*>(obj));
179 if (!obj->H_Parent())
180 pPhysicsShell->Activate(obj->XFORM(), 0, obj->XFORM(), not_active_state);
181 return pPhysicsShell;
182}
183
184void ApplySpawnIniToPhysicShell(CInifile* ini, CPhysicsShell* physics_shell, bool fixed)
185{

Callers 4

create_camera_shellFunction · 0.85
create_physic_shellMethod · 0.85
CreateBodyMethod · 0.85
CreateSkeletonMethod · 0.85

Calls 10

P_create_ShellFunction · 0.85
P_create_ElementFunction · 0.85
get_CDMethod · 0.80
VisualMethod · 0.80
add_ElementMethod · 0.80
identityMethod · 0.45
add_BoxMethod · 0.45
setMassMethod · 0.45
set_PhysicsRefObjectMethod · 0.45
ActivateMethod · 0.45

Tested by

no test coverage detected