| 193 | } |
| 194 | |
| 195 | void 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 | |
| 221 | void CPHCapture::ReleasedUpdate() |
| 222 | { |
nothing calls this directly
no test coverage detected