20 #ifndef ANTKEEPER_PHYSICS_MESH_COLLIDER_HPP
21 #define ANTKEEPER_PHYSICS_MESH_COLLIDER_HPP
98 std::shared_ptr<mesh_type> m_mesh;
Boundary representation (B-rep) of a mesh.
Bounding volume hierarchy (BVH).
Abstract base class for collision objects.
void set_mesh(std::shared_ptr< mesh_type > mesh)
Sets the collider's mesh.
constexpr mesh_collider() noexcept=default
Constructs an empty mesh collider.
geom::bvh bvh_type
Bounding volume hierarchy type.
constexpr const bvh_type & get_bvh() const noexcept
Returns the BVH of the collision mesh faces.
std::optional< std::tuple< float, std::uint32_t, math::fvec3 > > intersection(const geom::ray< float, 3 > &ray) const
Finds the nearest point of intersection between a ray and this collision mesh.
void rebuild_bvh()
Rebuilds the BVH of the collision mesh faces.
constexpr collider_type type() const noexcept override
Returns the collider type.
constexpr const std::shared_ptr< mesh_type > & get_mesh() const noexcept
Returns the collision mesh.
collider_type
Collider types.
Half of a line proceeding from an initial point.