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 <egg/core/Allocator.hh>
8
9#include <vector>
10
11namespace Kinoko {
12
13namespace Host {
14
15class Context;
16
17} // namespace Host
18
19namespace Field {
20
21class ObjectDrivableDirector : EGG::Disposer {
22 friend class Host::Context;
23
24public:
25 void init();
26 void calc();
27 void addObject(ObjectDrivable *obj);
28 void createObakeManager(const System::MapdataGeoObj &params);
29
30 [[nodiscard]] bool checkSpherePartial(f32 radius, const EGG::Vector3f &pos,
31 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info,
32 KCLTypeMask *maskOut, u32 timeOffset);
33 [[nodiscard]] bool checkSpherePartialPush(f32 radius, const EGG::Vector3f &pos,
34 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info,
35 KCLTypeMask *maskOut, u32 timeOffset);
36 [[nodiscard]] bool checkSphereFull(f32 radius, const EGG::Vector3f &pos,
37 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info,
38 KCLTypeMask *maskOut, u32 timeOffset);
39 [[nodiscard]] bool checkSphereFullPush(f32 radius, const EGG::Vector3f &pos,
40 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info,
41 KCLTypeMask *maskOut, u32 timeOffset);
42 [[nodiscard]] bool checkSphereCachedPartial(f32 radius, const EGG::Vector3f &pos,
43 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info,
44 KCLTypeMask *maskOut, u32 timeOffset);
45 [[nodiscard]] bool checkSphereCachedPartialPush(f32 radius, const EGG::Vector3f &pos,
46 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfoPartial *info,
47 KCLTypeMask *maskOut, u32 timeOffset);
48 [[nodiscard]] bool checkSphereCachedFullPush(f32 radius, const EGG::Vector3f &pos,
49 const EGG::Vector3f &prevPos, KCLTypeMask mask, CollisionInfo *info,
50 KCLTypeMask *maskOut, u32 timeOffset);
51 void colNarScLocal(f32 radius, const EGG::Vector3f &pos, KCLTypeMask mask, u32 timeOffset);
52
53 [[nodiscard]] ObjectObakeManager *obakeManager() const {
54 return m_obakeManager;
55 }
56
57 static ObjectDrivableDirector *CreateInstance();
58 static void DestroyInstance();
59
60 [[nodiscard]] static ObjectDrivableDirector *Instance() {
61 return s_instance;
62 }
63
64private:
65 EGG_NEW_DELETE_FRIEND
66
67 ObjectDrivableDirector();
68 ~ObjectDrivableDirector() override;
69
73
74 static constexpr size_t MAX_OBJECTS = 400;
75
76 static ObjectDrivableDirector *s_instance;
77};
78
79} // namespace Field
80
81} // 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.
fixed_vector< ObjectDrivable * > m_objects
All objects live here.
fixed_vector< ObjectDrivable * > m_calcObjects
Objects needing calc() live here too.
static constexpr size_t MAX_OBJECTS
Maximum number of objects in the vectors.
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
Dynamically sized array that only allocates once.
Definition Types.hh:177
Pertains to collision.
Represents the host application.
Definition HeapCommon.hh:11
A 3D float vector.
Definition Vector.hh:107