A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
ObjectCollisionConvexHull.hh
1#pragma once
2
3#include "game/field/ObjectCollisionBase.hh"
4
5namespace Field {
6
9public:
10 ObjectCollisionConvexHull(const std::span<const EGG::Vector3f> &points);
12
13 void transform(const EGG::Matrix34f &mat, const EGG::Vector3f &scale) override;
14 void transform(const EGG::Matrix34f &mat, const EGG::Vector3f &scale,
15 const EGG::Vector3f &speed) override;
16 const EGG::Vector3f &getSupport(const EGG::Vector3f &v) const override;
17
19 [[nodiscard]] f32 getBoundingRadius() const override {
20 return m_worldRadius;
21 }
22
24 [[nodiscard]] f32 initRadius() const {
25 return m_initRadius;
26 }
27
29 virtual void setBoundingRadius(f32 val) {
30 m_worldRadius = val;
31 }
32
33protected:
34 ObjectCollisionConvexHull(size_t count);
35
36 std::span<EGG::Vector3f> m_points;
37
38private:
39 const f32 m_initRadius;
40 std::span<EGG::Vector3f> m_worldPoints;
41 f32 m_worldRadius;
42};
43
44} // namespace Field
A 3 x 4 matrix.
Definition Matrix.hh:8
The base class that all objects' collision inherits from.
Smallest convex shape that encloses a given set of points.
ObjectCollisionConvexHull(const std::span< const EGG::Vector3f > &points)
Creates a convex hull with the provided points.
Pertains to collision.
A 3D float vector.
Definition Vector.hh:88