Fixes in modules

This commit is contained in:
2025-12-02 14:30:05 +03:00
parent 5b014dcb65
commit 6eed5063e6
16 changed files with 121 additions and 20 deletions

View File

@@ -14,6 +14,7 @@
#include "CharacterAnimationModule.h"
#include "PhysicsModule.h"
#include "EventModule.h"
#include "CharacterManagerModule.h"
#include "world-build.h"
namespace ECS
@@ -28,6 +29,8 @@ void setup_minimal()
ecs.component<Camera>().add(flecs::Singleton);
ecs.import <GameWorldModule>();
ecs.import <EventModule>();
ecs.import <CharacterManagerModule>();
ecs.import <WaterModule>();
ecs.component<InWater>();
ecs.component<WaterReady>().add(flecs::Singleton);
ecs.component<WaterAlmostReady>().add(flecs::Singleton);
@@ -40,7 +43,6 @@ void setup_minimal()
})
.add(flecs::Singleton);
/* lots of things depend on it */
ecs.component<TerrainReady>().add(flecs::Singleton);
ecs.component<Body2Entity>().add(flecs::Singleton);
}
void setup(Ogre::SceneManager *scnMgr, Ogre::SceneNode *cameraNode,
@@ -110,12 +112,9 @@ void setup(Ogre::SceneManager *scnMgr, Ogre::SceneNode *cameraNode,
std::cout << "Setup GameData done\n";
/* Create player */
player = ecs.entity("player");
Ogre::Vector3 playerPos(0, 0, 4);
player.set<CharacterLocation>({ { 0, 0, 0, 1 }, playerPos });
player.set<CharacterConf>({ "normal-male.glb" });
player.add<Character>();
player.add<Player>();
player = ecs.get_mut<CharacterManagerModule>().createPlayer(
{ 0, 0, 4 }, Ogre::Quaternion(Ogre::Radian(Ogre::Math::PI),
Ogre::Vector3::UNIT_Y));
}
void update(float delta)
{