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

Method CapturedUpdate

ogsr_engine/xrGame/PHCapture.cpp:195–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193}
194
195void CPHCapture::CapturedUpdate()
196{
197 m_island.Unmerge();
198 if (m_character->CPHObject::is_active())
199 {
200 m_taget_element->Enable();
201 }
202
203 if (!m_taget_element->isActive() || (!m_hard_mode && dDOT(m_joint_feedback.f2, m_joint_feedback.f2) > m_capture_force * m_capture_force))
204 {
205 Release();
206 return;
207 }
208
209 float mag = dSqrt(dDOT(m_joint_feedback.f1, m_joint_feedback.f1));
210
211 if (b_character_feedback && mag > m_capture_force / 2.2f)
212 {
213 float f = mag / (m_capture_force / 15.f);
214 m_character->ApplyForce(m_joint_feedback.f1[0] / f, m_joint_feedback.f1[1] / f, m_joint_feedback.f1[2] / f);
215 }
216
217 Fvector capture_bone_position = GetCapturePosition();
218 dBodySetPosition(m_body, capture_bone_position.x, capture_bone_position.y, capture_bone_position.z);
219}
220
221void CPHCapture::ReleasedUpdate()
222{

Callers

nothing calls this directly

Calls 5

dBodySetPositionFunction · 0.85
UnmergeMethod · 0.80
ApplyForceMethod · 0.80
EnableMethod · 0.45
isActiveMethod · 0.45

Tested by

no test coverage detected