| 477 | } |
| 478 | |
| 479 | void ModelRigidRope(ROPE_STRUCT* rope, PENDULUM* pendulumPointer, Vector3i* ropeVelocity, Vector3i* pendulumVelocity, int value) |
| 480 | { |
| 481 | Vector3i vec; |
| 482 | vec.x = pendulumPointer->position.x + pendulumVelocity->x - rope->segment[0].x; |
| 483 | vec.y = pendulumPointer->position.y + pendulumVelocity->y - rope->segment[0].y; |
| 484 | vec.z = pendulumPointer->position.z + pendulumVelocity->z - rope->segment[0].z; |
| 485 | |
| 486 | int result = 65536 * sqrt(abs(pow(vec.x >> FP_SHIFT, 2) + pow(vec.y >> FP_SHIFT, 2) + pow(vec.z >> FP_SHIFT, 2))) - value; |
| 487 | NormaliseRopeVector(&vec); |
| 488 | |
| 489 | pendulumVelocity->x -= (int64_t)result * vec.x >> FP_SHIFT; |
| 490 | pendulumVelocity->y -= (int64_t)result * vec.y >> FP_SHIFT; |
| 491 | pendulumVelocity->z -= (int64_t)result * vec.z >> FP_SHIFT; |
| 492 | } |
| 493 | |
| 494 | void ModelRigid(Vector3i* segment, Vector3i* nextSegment, Vector3i* velocity, Vector3i* nextVelocity, int length) |
| 495 | { |
no test coverage detected