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 f32 getBoundingRadius() const override {
20 return m_worldRadius;
21 }
22
24 virtual void setBoundingRadius(f32 val) {
25 m_worldRadius = val;
26 }
27
28protected:
29 ObjectCollisionConvexHull(size_t count);
30
31 std::span<EGG::Vector3f> m_points;
32
33private:
34 std::span<EGG::Vector3f> m_worldPoints;
35 f32 m_worldRadius;
36};
37
38} // 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