A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
ObjectDrivableDirector.hh
1#pragma once
2
3#include "game/field/obj/ObjectCollidable.hh"
4#include "game/field/obj/ObjectDrivable.hh"
5#include "game/field/obj/ObjectObakeManager.hh"
6
7#include <vector>
8
9namespace Kinoko {
10
11namespace Host {
12
13class Context;
14
15} // namespace Host
16
17namespace Field {
18
20 friend class Host::Context;
21
22public:
23 void init();
24 void calc();
25 void addObject(ObjectDrivable *obj);
26 void createObakeManager(const System::MapdataGeoObj &params);
27
28 [[nodiscard]] bool checkSpherePartial(f32 radius, const EGG::Vector3f &pos,
29 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info,
30 KCLTypeMask *maskOut, u32 timeOffset);
31 [[nodiscard]] bool checkSpherePartialPush(f32 radius, const EGG::Vector3f &pos,
32 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info,
33 KCLTypeMask *maskOut, u32 timeOffset);
34 [[nodiscard]] bool checkSphereFull(f32 radius, const EGG::Vector3f &pos,
35 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info,
36 KCLTypeMask *maskOut, u32 timeOffset);
37 [[nodiscard]] bool checkSphereFullPush(f32 radius, const EGG::Vector3f &pos,
38 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info,
39 KCLTypeMask *maskOut, u32 timeOffset);
40 [[nodiscard]] bool checkSphereCachedPartial(f32 radius, const EGG::Vector3f &pos,
41 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info,
42 KCLTypeMask *maskOut, u32 timeOffset);
43 [[nodiscard]] bool checkSphereCachedPartialPush(f32 radius, const EGG::Vector3f &pos,
44 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info,
45 KCLTypeMask *maskOut, u32 timeOffset);
46 [[nodiscard]] bool checkSphereCachedFullPush(f32 radius, const EGG::Vector3f &pos,
47 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info,
48 KCLTypeMask *maskOut, u32 timeOffset);
49 void colNarScLocal(f32 radius, const EGG::Vector3f &pos, KCLTypeMask mask, u32 timeOffset);
50
51 [[nodiscard]] ObjectObakeManager *obakeManager() const {
52 return m_obakeManager;
53 }
54
55 static ObjectDrivableDirector *CreateInstance();
56 static void DestroyInstance();
57
58 [[nodiscard]] static ObjectDrivableDirector *Instance() {
59 return s_instance;
60 }
61
62private:
64 ~ObjectDrivableDirector() override;
65
66 std::vector<ObjectDrivable *> m_objects;
67 std::vector<ObjectDrivable *> m_calcObjects;
69
70 static ObjectDrivableDirector *s_instance;
71};
72
73} // namespace Field
74
75} // namespace Kinoko
An interface for ensuring certain structures and classes are destroyed with the heap.
Definition Disposer.hh:11
ObjectObakeManager * m_obakeManager
Manages rGV2 blocks and spatial indexing.
void createObakeManager(const System::MapdataGeoObj &params)
Creates the rGV2 block manager. Also implicitly adds the block represented by params.
std::vector< ObjectDrivable * > m_calcObjects
Objects needing calc() live here too.
std::vector< ObjectDrivable * > m_objects
All objects live here.
The manager class for SNES Ghost Valley 2 blocks.
Contexts can be used to restore a previous memory state for the current session.
Definition Context.hh:71
A 3D float vector.
Definition Vector.hh:107