A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
ObjectAurora.hh
1#pragma once
2
3#include "game/field/obj/ObjectDrivable.hh"
4
5namespace Field {
6
8public:
10 ~ObjectAurora() override;
11
12 void init() override;
13 [[nodiscard]] u32 loadFlags() const override;
14 void createCollision() override;
15 void calcCollisionTransform() override;
16 f32 getCollisionRadius() const override;
17
18 [[nodiscard]] bool checkPointPartial(const EGG::Vector3f &v0, const EGG::Vector3f &v1,
19 KCLTypeMask flags, CollisionInfoPartial *pInfo, KCLTypeMask *pFlagsOut) override;
20 [[nodiscard]] bool checkPointPartialPush(const EGG::Vector3f &v0, const EGG::Vector3f &v1,
21 KCLTypeMask flags, CollisionInfoPartial *pInfo, KCLTypeMask *pFlagsOut) override;
22 [[nodiscard]] bool checkPointFull(const EGG::Vector3f &v0, const EGG::Vector3f &v1,
23 KCLTypeMask flags, CollisionInfo *pInfo, KCLTypeMask *pFlagsOut) override;
24 [[nodiscard]] bool checkPointFullPush(const EGG::Vector3f &v0, const EGG::Vector3f &v1,
25 KCLTypeMask flags, CollisionInfo *pInfo, KCLTypeMask *pFlagsOut) override;
26 [[nodiscard]] bool checkSpherePartial(f32 radius, const EGG::Vector3f &v0,
27 const EGG::Vector3f &v1, KCLTypeMask flags, CollisionInfoPartial *pInfo,
28 KCLTypeMask *pFlagsOut, u32 timeOffset) override;
29 [[nodiscard]] bool checkSpherePartialPush(f32 radius, const EGG::Vector3f &v0,
30 const EGG::Vector3f &v1, KCLTypeMask flags, CollisionInfoPartial *pInfo,
31 KCLTypeMask *pFlagsOut, u32 timeOffset) override;
32 [[nodiscard]] bool checkSphereFull(f32 radius, const EGG::Vector3f &v0, const EGG::Vector3f &v1,
33 KCLTypeMask flags, CollisionInfo *pInfo, KCLTypeMask *pFlagsOut,
34 u32 timeOffset) override;
35 [[nodiscard]] bool checkSphereFullPush(f32 radius, const EGG::Vector3f &v0,
36 const EGG::Vector3f &v1, KCLTypeMask flags, CollisionInfo *pInfo,
37 KCLTypeMask *pFlagsOut, u32 timeOffset) override;
38 [[nodiscard]] bool checkPointCachedPartial(const EGG::Vector3f &v0, const EGG::Vector3f &v1,
39 KCLTypeMask flags, CollisionInfoPartial *pInfo, KCLTypeMask *pFlagsOut) override;
40 [[nodiscard]] bool checkPointCachedPartialPush(const EGG::Vector3f &v0, const EGG::Vector3f &v1,
41 KCLTypeMask flags, CollisionInfoPartial *pInfo, KCLTypeMask *pFlagsOut) override;
42 [[nodiscard]] bool checkPointCachedFull(const EGG::Vector3f &v0, const EGG::Vector3f &v1,
43 KCLTypeMask flags, CollisionInfo *pInfo, KCLTypeMask *pFlagsOut) override;
44 [[nodiscard]] bool checkPointCachedFullPush(const EGG::Vector3f &v0, const EGG::Vector3f &v1,
45 KCLTypeMask flags, CollisionInfo *pInfo, KCLTypeMask *pFlagsOut) override;
46 [[nodiscard]] bool checkSphereCachedPartial(f32 radius, const EGG::Vector3f &v0,
47 const EGG::Vector3f &v1, KCLTypeMask flags, CollisionInfoPartial *pInfo,
48 KCLTypeMask *pFlagsOut, u32 timeOffset) override;
49 [[nodiscard]] bool checkSphereCachedPartialPush(f32 radius, const EGG::Vector3f &v0,
50 const EGG::Vector3f &v1, KCLTypeMask flags, CollisionInfoPartial *pInfo,
51 KCLTypeMask *pFlagsOut, u32 timeOffset) override;
52 [[nodiscard]] bool checkSphereCachedFull(f32 radius, const EGG::Vector3f &v0,
53 const EGG::Vector3f &v1, KCLTypeMask flags, CollisionInfo *pInfo,
54 KCLTypeMask *pFlagsOut, u32 timeOffset) override;
55 [[nodiscard]] bool checkSphereCachedFullPush(f32 radius, const EGG::Vector3f &v0,
56 const EGG::Vector3f &v1, KCLTypeMask flags, CollisionInfo *pInfo,
57 KCLTypeMask *pFlagsOut, u32 timeOffset) override;
58
59private:
60 [[nodiscard]] bool checkSpherePartialImpl(f32 radius, const EGG::Vector3f &v0,
61 const EGG::Vector3f &v1, KCLTypeMask flags, CollisionInfoPartial *pInfo,
62 KCLTypeMask *pFlagsOut, u32 timeOffset);
63 [[nodiscard]] bool checkSpherePartialPushImpl(f32 radius, const EGG::Vector3f &v0,
64 const EGG::Vector3f &v1, KCLTypeMask flags, CollisionInfoPartial *pInfo,
65 KCLTypeMask *pFlagsOut, u32 timeOffset);
66 [[nodiscard]] bool checkSphereFullImpl(f32 radius, const EGG::Vector3f &v0,
67 const EGG::Vector3f &v1, KCLTypeMask flags, CollisionInfo *pInfo,
68 KCLTypeMask *pFlagsOut, u32 timeOffset);
69 [[nodiscard]] bool checkSphereFullPushImpl(f32 radius, const EGG::Vector3f &v0,
70 const EGG::Vector3f &v1, KCLTypeMask flags, CollisionInfo *pInfo,
71 KCLTypeMask *pFlagsOut, u32 timeOffset);
72
73 [[nodiscard]] bool checkSpherePartialImpl(f32 radius, const EGG::Vector3f &v0,
74 const EGG::Vector3f &v1, KCLTypeMask flags, CollisionInfoPartial *pInfo,
75 KCLTypeMask *pFlagsOut, u32 timeOffset, bool push);
76
77 [[nodiscard]] bool checkSphereFullImpl(f32 radius, const EGG::Vector3f &v0,
78 const EGG::Vector3f &v1, KCLTypeMask flags, CollisionInfo *pInfo,
79 KCLTypeMask *pFlagsOut, u32 timeOffset, bool push);
80
81 [[nodiscard]] bool calcCollision(f32 radius, const EGG::Vector3f &vel, u32 time,
82 EGG::Vector3f &v0, EGG::Vector3f &fnrm, f32 &dist);
83
84 static constexpr EGG::Vector3f COLLISION_SIZE = EGG::Vector3f(2000.0f, 2000.0f, 15000.0f);
85};
86
87} // namespace Field
bool calcCollision(f32 radius, const EGG::Vector3f &vel, u32 time, EGG::Vector3f &v0, EGG::Vector3f &fnrm, f32 &dist)
Calculates the sin-like collision of the wavy road.
Pertains to collision.
A 3D float vector.
Definition Vector.hh:83