|
Capycore Engine
0.1.0
A simple and lightweight game engine written in C++ based on the Unity API architecture.
|
Class responsible for raycasting in the physics world. More...
#include <physics_raycaster.h>
Public Member Functions | |
| PhysicsRaycaster (b2WorldId world_id) | |
| ColliderRayResult | raycast_closest (const b2Vec2 &origin, const b2Vec2 &translation) |
| Closest hit. | |
| std::vector< ColliderRayResult > | raycast_all (const b2Vec2 &origin, const b2Vec2 &translation, b2QueryFilter filter={}) |
| All hits. | |
| std::vector< ColliderRayResult > | raycast_filtered (const b2Vec2 &origin, const b2Vec2 &translation, uint16_t category_mask) |
| Filtered hits by category mask. | |
| ColliderRayResult | raycast_segment (const b2Vec2 &start, const b2Vec2 &end) |
| Raycast segment. | |
Class responsible for raycasting in the physics world.
This class provides functionality to perform raycasting operations within the Box2D physics simulation.
| PhysicsRaycaster::PhysicsRaycaster | ( | b2WorldId | world_id | ) |
| std::vector< ColliderRayResult > PhysicsRaycaster::raycast_all | ( | const b2Vec2 & | origin, |
| const b2Vec2 & | translation, | ||
| b2QueryFilter | filter = {} |
||
| ) |
All hits.
Returns all hits along the ray, sorted by distance from the origin.
| origin | The starting point of the ray. |
| translation | The direction and length of the ray. |
| filter | The query filter to apply. |
| ColliderRayResult PhysicsRaycaster::raycast_closest | ( | const b2Vec2 & | origin, |
| const b2Vec2 & | translation | ||
| ) |
Closest hit.
Meant for simple raycasts where only the closest hit is needed.
| origin | The starting point of the ray. |
| translation | The direction and length of the ray. |
| std::vector< ColliderRayResult > PhysicsRaycaster::raycast_filtered | ( | const b2Vec2 & | origin, |
| const b2Vec2 & | translation, | ||
| uint16_t | category_mask | ||
| ) |
Filtered hits by category mask.
Returns all hits along the ray that match the given category mask.
| origin | The starting point of the ray. |
| translation | The direction and length of the ray. |
| category_mask | The category mask to filter results. |
| ColliderRayResult PhysicsRaycaster::raycast_segment | ( | const b2Vec2 & | start, |
| const b2Vec2 & | end | ||
| ) |
Raycast segment.
Performs a raycast between two points, returning the first hit encountered.
| start | The starting point of the segment. |
| end | The ending point of the segment. |