persona-3-dual
A DS demake of Persona 3
Loading...
Searching...
No Matches
MovementComponent.hpp
Go to the documentation of this file.
1
6
7#pragma once
8
11
12#include "core/routerIDs.hpp"
13#include <aegis/component.hpp>
14#include <aegis/ndsTypes.hpp>
15#include <aegis/types.hpp>
16
20
21class MovementComponent : public ae::Component
22{
23 public:
24 static constexpr ae::ComponentTypeID TYPE_ID = static_cast<ae::ComponentTypeID>(ComponentType::Movement);
25 void init() override;
26
27 void destroy() override;
28
34 void update(ae::q20_12_t /*dt*/) override;
35
36 ae::ComponentTypeID getType() const override
37 {
38 return TYPE_ID;
39 }
40
49
55 void start();
56
60 void stop();
61
68
78
79 protected:
80 void submitToManager() override
81 {
82 }
83
84 private:
85 ae::q20_12_t getGroundHeight(ae::q20_12_t x, ae::q20_12_t z) const;
86
87 MathManager& math = MathManager::getInstance();
89
94
103 TileType isTileAt(int tileX, int tileY);
104
112 bool isTileWalkable(ae::q20_12_t worldX, ae::q20_12_t worldZ);
113};
Manages the camera for a 3D environment view.
CameraMode
Controls how the camera behaves each frame.
TileType
Loads, animates, and renders a model in the DS geometry engine.
static AnimationController * getInstance()
void update(ae::q20_12_t) override
Core update loop that calculates the character & camera movement.
void start()
Start the update(ae::q20_12_t) loop by setting active to true.
TileType isTileAt()
Get the tile value at the current character position.
void submitToManager() override
void configureMovement(const MovementConfig &config)
Configure the movement system.
void stop()
Stop the update(ae::q20_12_t) loop by setting active to false.
bool isTileWalkable(ae::q20_12_t worldX, ae::q20_12_t worldZ)
Checks for collision at the given position.
ae::ComponentTypeID getType() const override
CharacterPosition isCharacterAt()
Get the current character position.
void destroy() override
ae::q20_12_t getGroundHeight(ae::q20_12_t x, ae::q20_12_t z) const
AnimationController * animationCtrl
static constexpr ae::ComponentTypeID TYPE_ID
Holds routerIDs used for systems.
A struct that holds initial config values for the MovementComponent.