Called when a raycast hit occurs (used to move a body with the mouse)
| 685 | |
| 686 | // Called when a raycast hit occurs (used to move a body with the mouse) |
| 687 | rp3d::decimal SceneDemo::notifyRaycastHit(const rp3d::RaycastInfo& raycastInfo) { |
| 688 | |
| 689 | rp3d::RigidBody* body = dynamic_cast<rp3d::RigidBody*>(raycastInfo.body); |
| 690 | mMovingBody = body; |
| 691 | const rp3d::Transform localToWorldTransform = raycastInfo.collider->getLocalToWorldTransform(); |
| 692 | mMovingBodyLocalPoint = localToWorldTransform.getInverse() * raycastInfo.worldPoint; |
| 693 | |
| 694 | return raycastInfo.hitFraction; |
| 695 | } |
| 696 | |
| 697 | // Update the engine settings |
| 698 | void SceneDemo::updateEngineSettings() { |
no test coverage detected