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 Host {
10
11class Context;
12
13} // namespace Host
14
15namespace Field {
16
18 friend class Host::Context;
19
20public:
21 void init();
22 void calc();
23 void addObject(ObjectDrivable *obj);
24 void createObakeManager(const System::MapdataGeoObj &params);
25
26 [[nodiscard]] bool checkSpherePartial(f32 radius, const EGG::Vector3f &pos,
27 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info,
28 KCLTypeMask *maskOut, u32 timeOffset);
29 [[nodiscard]] bool checkSpherePartialPush(f32 radius, const EGG::Vector3f &pos,
30 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info,
31 KCLTypeMask *maskOut, u32 timeOffset);
32 [[nodiscard]] bool checkSphereFull(f32 radius, const EGG::Vector3f &pos,
33 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info,
34 KCLTypeMask *maskOut, u32 timeOffset);
35 [[nodiscard]] bool checkSphereFullPush(f32 radius, const EGG::Vector3f &pos,
36 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info,
37 KCLTypeMask *maskOut, u32 timeOffset);
38 [[nodiscard]] bool checkSphereCachedPartial(f32 radius, const EGG::Vector3f &pos,
39 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info,
40 KCLTypeMask *maskOut, u32 timeOffset);
41 [[nodiscard]] bool checkSphereCachedPartialPush(f32 radius, const EGG::Vector3f &pos,
42 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info,
43 KCLTypeMask *maskOut, u32 timeOffset);
44 [[nodiscard]] bool checkSphereCachedFullPush(f32 radius, const EGG::Vector3f &pos,
45 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info,
46 KCLTypeMask *maskOut, u32 timeOffset);
47 void colNarScLocal(f32 radius, const EGG::Vector3f &pos, KCLTypeMask mask, u32 timeOffset);
48
49 [[nodiscard]] ObjectObakeManager *obakeManager() const {
50 return m_obakeManager;
51 }
52
53 static ObjectDrivableDirector *CreateInstance();
54 static void DestroyInstance();
55
56 [[nodiscard]] static ObjectDrivableDirector *Instance() {
57 return s_instance;
58 }
59
60private:
62 ~ObjectDrivableDirector() override;
63
64 std::vector<ObjectDrivable *> m_objects;
65 std::vector<ObjectDrivable *> m_calcObjects;
67
68 static ObjectDrivableDirector *s_instance;
69};
70
71} // namespace Field
An interface for ensuring certain structures and classes are destroyed with the heap.
Definition Disposer.hh:11
std::vector< ObjectDrivable * > m_objects
All objects live here.
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.
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:59
Pertains to collision.
Represents the host application.
Definition HeapCommon.hh:9
A 3D float vector.
Definition Vector.hh:87