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

Method CreateBroken

ogsr_engine/xrGame/BreakableObject.cpp:134–152  ·  view source on GitHub ↗

}

Source from the content-addressed store, hash-verified

132
133//}
134void CBreakableObject::CreateBroken()
135{
136 processing_activate();
137 m_Shell = P_create_splited_Shell();
138 m_Shell->preBuild_FromKinematics(smart_cast<IKinematics*>(Visual()));
139 m_Shell->mXFORM.set(XFORM());
140 // m_Shell->SetAirResistance(0.002f*skel_airr_lin_factor,
141 // 0.3f*skel_airr_ang_factor);
142 m_Shell->set_PhysicsRefObject(this);
143 m_Shell->Build();
144 m_Shell->setMass(m_Shell->getMass() * 0.1f * 100.f);
145 dMass m;
146 dMassSetBox(&m, m_Shell->getMass() / 100.f, 1.f, 1.f, 1.f);
147 m_Shell->addEquelInertiaToEls(m);
148 m_Shell->SmoothElementsInertia(0.3f);
149 Fobb b;
150 Visual()->getVisData().box.getradius(b.m_halfsize);
151 m_Shell->SetMaxAABBRadius(_max(_max(b.m_halfsize.x, b.m_halfsize.y), b.m_halfsize.z) * 2.f); //+2.f
152}
153
154void CBreakableObject::ActivateBroken()
155{

Callers

nothing calls this directly

Calls 15

P_create_splited_ShellFunction · 0.85
VisualFunction · 0.85
XFORMFunction · 0.85
dMassSetBoxFunction · 0.85
addEquelInertiaToElsMethod · 0.80
SmoothElementsInertiaMethod · 0.80
SetMaxAABBRadiusMethod · 0.80
_maxFunction · 0.50
setMethod · 0.45
set_PhysicsRefObjectMethod · 0.45
BuildMethod · 0.45

Tested by

no test coverage detected