Converted to ECS, physics fix

This commit is contained in:
2025-09-02 16:07:03 +03:00
parent b434e516f0
commit 847aab6ed0
12 changed files with 766 additions and 639 deletions

50
src/gamedata/Components.h Normal file
View File

@@ -0,0 +1,50 @@
#ifndef COMPONENTS_H_
#define COMPONENTS_H_
#include <Ogre.h>
#include <OgreBullet.h>
namespace ECS
{
struct GameData {
int tmp;
};
struct EngineData {
Ogre::SceneManager *mScnMgr;
Ogre::Bullet::DynamicsWorld *mWorld;
float delta;
};
struct Vector3 {
float x;
float y;
float z;
bool zeroLength() const;
};
struct Vector2 {
float x, y;
};
struct Input {
uint32_t control;
uint32_t control_prev;
Vector3 motion;
Vector2 mouse;
float wheel_y;
bool mouse_moved;
bool wheel_moved;
bool fast;
Input()
: control(0)
, control_prev(0)
, motion({ 0, 0, 0 })
, fast(false)
{
}
};
struct Camera {
Ogre::SceneNode *mCameraNode;
Ogre::Camera *mCamera;
bool configured;
Ogre::SceneNode *mCameraPivot;
Ogre::SceneNode *mCameraGoal;
Ogre::Real mPivotPitch;
};
}
#endif