converted to Jolt physics

This commit is contained in:
2025-11-23 02:00:31 +03:00
parent 3f0484e87c
commit cd82fb0eed
52 changed files with 4302 additions and 1458 deletions

View File

@@ -0,0 +1,57 @@
#ifndef _PHYSICS_MODULE_H_
#define _PHYSICS_MODULE_H_
#include <flecs.h>
class JoltPhysicsWrapper;
namespace JPH
{
class Shape;
class CharacterBase;
}
namespace Ogre
{
class TerrainGroup;
}
namespace ECS
{
struct Physics {
JoltPhysicsWrapper *physics;
};
struct PhysicsNode {
Ogre::SceneNode *node;
};
struct PhysicsMeshName {
Ogre::String meshName;
};
struct PhysicsMeshPtr {
Ogre::MeshPtr mesh;
};
struct PhysicsBody {
uint32_t motion;
uint32_t layer;
};
struct CharacterBody {
std::shared_ptr<JPH::CharacterBase> ch;
};
struct BoatBody {
void *tmp;
};
struct PhysicsHeightfieldData {
const float *samples;
Ogre::Vector3 offset;
Ogre::Vector3 scale;
int sampleCount;
};
struct CharacterVelocity {
Ogre::Vector3 gvelocity;
Ogre::Vector3 velocity;
};
struct PhysicsModule {
PhysicsModule(flecs::world &ecs);
static flecs::entity createTerrainChunkBody(Ogre::SceneNode *node,
float *samples,
const Ogre::Vector3 &offset,
const Ogre::Vector3 &scale,
int sampleCount);
};
}
#endif