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

Method activate_physic_shell

ogsr_engine/xrGame/PhysicsShellHolder.cpp:148–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146}
147
148void CPhysicsShellHolder::activate_physic_shell()
149{
150 VERIFY(!m_pPhysicsShell);
151 create_physic_shell();
152 Fvector l_fw, l_up;
153 l_fw.set(XFORM().k);
154 l_up.set(XFORM().j);
155 l_fw.mul(2.f);
156 l_up.mul(2.f);
157
158 Fmatrix l_p1, l_p2;
159 l_p1.set(XFORM());
160 l_p2.set(XFORM());
161 l_fw.mul(2.f);
162 l_p2.c.add(l_fw);
163
164 m_pPhysicsShell->Activate(l_p1, 0, l_p2);
165 if (H_Parent() && H_Parent()->Visual())
166 {
167 smart_cast<IKinematics*>(H_Parent()->Visual())->CalculateBones_Invalidate();
168 smart_cast<IKinematics*>(H_Parent()->Visual())->CalculateBones();
169 Fvector dir = H_Parent()->Direction();
170 dir.y = 0;
171 l_fw.set(normalize(dir) * 2.f);
172 }
173 smart_cast<IKinematics*>(Visual())->CalculateBones_Invalidate();
174 smart_cast<IKinematics*>(Visual())->CalculateBones();
175 // XFORM().set (l_p1);
176 correct_spawn_pos();
177
178 Fvector overriden_vel;
179 if (ActivationSpeedOverriden(overriden_vel, true))
180 {
181 m_pPhysicsShell->set_LinearVel(overriden_vel);
182 }
183 else
184 {
185 m_pPhysicsShell->set_LinearVel(l_fw);
186 }
187 m_pPhysicsShell->GetGlobalTransformDynamic(&XFORM());
188}
189
190void CPhysicsShellHolder::setup_physic_shell()
191{

Callers

nothing calls this directly

Calls 14

XFORMFunction · 0.85
H_ParentFunction · 0.85
normalizeFunction · 0.85
VisualFunction · 0.85
VisualMethod · 0.80
DirectionMethod · 0.80
setMethod · 0.45
mulMethod · 0.45
addMethod · 0.45
ActivateMethod · 0.45
CalculateBonesMethod · 0.45

Tested by

no test coverage detected