A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
ObjectDrivable.hh
1#pragma once
2
3#include "game/field/CourseColMgr.hh"
5#include "game/field/ObjectCollisionBase.hh"
6#include "game/field/obj/ObjectBase.hh"
7
8namespace Field {
9
10class ObjectDrivable : public ObjectBase {
11public:
13 ~ObjectDrivable() override;
14
15 void load() override;
16
18 [[nodiscard]] f32 getCollisionRadius() const override {
19 return 5000.0f;
20 }
21
22 virtual void initCollision() {}
23 virtual void loadAABB(f32 radius);
24
25 [[nodiscard]] virtual bool checkPointPartial(const EGG::Vector3f &pos,
26 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info,
27 KCLTypeMask *maskOut) = 0;
28 [[nodiscard]] virtual bool checkPointPartialPush(const EGG::Vector3f &pos,
29 const EGG::Vector3f &prevPos, KCLTypeMask flags, CollisionInfoPartial *info,
30 KCLTypeMask *maskOut) = 0;
31 [[nodiscard]] virtual bool checkPointFull(const EGG::Vector3f &pos,
32 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info,
33 KCLTypeMask *maskOut) = 0;
34 [[nodiscard]] virtual bool checkPointFullPush(const EGG::Vector3f &pos,
35 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info,
36 KCLTypeMask *maskOut) = 0;
37
38 [[nodiscard]] virtual bool checkSpherePartial(f32 radius, const EGG::Vector3f &pos,
39 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info,
40 KCLTypeMask *maskOut, u32 timeOffset) = 0;
41 [[nodiscard]] virtual bool checkSpherePartialPush(f32 radius, const EGG::Vector3f &pos,
42 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info,
43 KCLTypeMask *maskOut, u32 timeOffset) = 0;
44 [[nodiscard]] virtual bool checkSphereFull(f32 radius, const EGG::Vector3f &pos,
45 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info,
46 KCLTypeMask *maskOut, u32 timeOffset) = 0;
47 [[nodiscard]] virtual bool checkSphereFullPush(f32 radius, const EGG::Vector3f &pos,
48 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info,
49 KCLTypeMask *maskOut, u32 timeOffset) = 0;
50
51 virtual void narrScLocal(f32 /*radius*/, const EGG::Vector3f & /*pos*/, KCLTypeMask /*mask*/,
52 u32 /*timeOffset*/) {}
53
54 [[nodiscard]] virtual bool checkPointCachedPartial(const EGG::Vector3f &pos,
55 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info,
56 KCLTypeMask *maskOut) = 0;
57 [[nodiscard]] virtual bool checkPointCachedPartialPush(const EGG::Vector3f &pos,
58 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info,
59 KCLTypeMask *maskOut) = 0;
60 [[nodiscard]] virtual bool checkPointCachedFull(const EGG::Vector3f &pos,
61 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info,
62 KCLTypeMask *maskOut) = 0;
63 [[nodiscard]] virtual bool checkPointCachedFullPush(const EGG::Vector3f &pos,
64 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info,
65 KCLTypeMask *maskOut) = 0;
66
67 [[nodiscard]] virtual bool checkSphereCachedPartial(f32 radius, const EGG::Vector3f &pos,
68 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info,
69 KCLTypeMask *maskOut, u32 timeOffset) = 0;
70 [[nodiscard]] virtual bool checkSphereCachedPartialPush(f32 radius, const EGG::Vector3f &pos,
71 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info,
72 KCLTypeMask *maskOut, u32 timeOffset) = 0;
73 [[nodiscard]] virtual bool checkSphereCachedFull(f32 radius, const EGG::Vector3f &pos,
74 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info,
75 KCLTypeMask *maskOut, u32 timeOffset) = 0;
76 [[nodiscard]] virtual bool checkSphereCachedFullPush(f32 radius, const EGG::Vector3f &pos,
77 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info,
78 KCLTypeMask *maskOut, u32 timeOffset) = 0;
79};
80
81} // namespace Field
Pertains to collision.
A 3D float vector.
Definition Vector.hh:83