1#include "KartObjectManager.hh"
3#include "game/kart/KartCollide.hh"
4#include "game/kart/KartParamFileManager.hh"
5#include "game/system/RaceConfig.hh"
10void KartObjectManager::init() {
11 for (
size_t i = 0; i < m_count; ++i) {
12 m_objects[i]->initImpl();
18void KartObjectManager::calc() {
19 for (
size_t i = 0; i < m_count; ++i) {
20 KartObject *
object = m_objects[i];
21 object->collide()->setTangentOff(EGG::Vector3f::zero);
22 object->collide()->setMovement(EGG::Vector3f::zero);
25 for (
size_t i = 0; i < m_count; ++i) {
26 KartObject *
object = m_objects[i];
33KartObjectManager *KartObjectManager::CreateInstance() {
35 s_instance =
new KartObjectManager;
40void KartObjectManager::DestroyInstance() {
42 auto *instance = s_instance;
48KartObjectManager::KartObjectManager() {
49 const auto &raceScenario = System::RaceConfig::Instance()->raceScenario();
50 m_count = raceScenario.playerCount;
51 m_objects =
new KartObject *[m_count];
52 KartParamFileManager::CreateInstance();
53 for (
size_t i = 0; i < m_count; ++i) {
54 const auto &player = raceScenario.players[i];
55 KartObject *
object = KartObject::Create(player.character, player.vehicle, i);
56 object->createModel();
57 m_objects[i] = object;
62KartObjectManager::~KartObjectManager() {
65 WARN(
"KartObjectManager instance not explicitly handled!");
68 KartParamFileManager::DestroyInstance();
70 for (
size_t i = 0; i < m_count; ++i) {
79 KartObjectProxy::proxyList().clear();
82KartObjectManager *KartObjectManager::s_instance =
nullptr;
void prepare()
Sets the initial position and rotation of the kart based off the current track.
Pertains to kart-related functionality.