… physics plugin (#614)
# Pull Request
## Description
Added a Raycast utility function
## Related Issues (Optional, put "None" if there are no related issues)
Fixes #595
## Type of Change
<!-- Please delete options that are not relevant. -->
- New feature (non-breaking change which adds functionality)
## Changes Made
List of the main changes in this PR:
- Added `CastRay` method
- New `Ray` struct
- New `HitRecord` struct
## Testing (Optional, put "None" if you didn't have to test anything)
<!-- Describe the tests you ran to verify your changes. Please delete
options that are not relevant. -->
- Unit tests pass (`xmake test`)
- Code follows the project's style guidelines (`clang-format`)
### Test Environment
- OS: macOS
- Compiler: Clang
## Documentation
<!-- Please delete options that are not relevant. -->
None
## Checklist (Don't delete any options)
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] New and existing unit tests pass locally with my changes
- [x] Any dependent changes have been merged and published
## Time Spent (Optional, put "None" if you don't know)
<!-- Put here the time you were actively working on it like: 5 minutes,
4 hours, some days, at least 1 month -->
less that 1h
## Screenshots/Videos (Optional, put "None" if it's not relevant)
<!-- Add screenshots or videos to help explain your changes. -->
None
## Breaking Changes (Optional, Put "None" if there are no breaking
changes)
<!-- If this PR introduces breaking changes, describe them here and
provide migration instructions. -->
None
## Additional Notes (Optional, Put "None" if there are no additional
notes)
<!-- Any additional information that reviewers should know. -->
None
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Ray-casting support to detect intersections between rays and physics
objects in the world, returning hit time and target entity.
* **API Improvements**
* Added a read-only accessor for the physics system to enable const-safe
queries.
* **Tests**
* New tests covering ray-casting: scenarios with and without hits,
validating returned entity and intersection time.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->