converted to Jolt physics
This commit is contained in:
57
src/gamedata/PhysicsModule.h
Normal file
57
src/gamedata/PhysicsModule.h
Normal 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
|
||||
Reference in New Issue
Block a user