2#ifdef StevEngine_PHYSICS
8#include <Jolt/Physics/Collision/BroadPhase/BroadPhaseLayer.h>
10namespace StevEngine::Physics {
11 namespace BroadPhaseLayers
14 static constexpr JPH::BroadPhaseLayer NON_MOVING(0);
16 static constexpr JPH::BroadPhaseLayer MOVING(1);
29 const JPH::ObjectLayer
id;
40 static JPH::ObjectLayer currentId;
41 static std::map<unsigned int, Layer*> layers;
42 static std::map<std::string, Layer*> layersByName;
84 virtual JPH::BroadPhaseLayer
GetBroadPhaseLayer(JPH::ObjectLayer inLayer)
const override;
101 virtual bool ShouldCollide(JPH::ObjectLayer inLayer1, JPH::BroadPhaseLayer inLayer2)
const override;
118 virtual bool ShouldCollide(JPH::ObjectLayer inObject1, JPH::ObjectLayer inObject2)
const override;
virtual unsigned int GetNumBroadPhaseLayers() const override
Get number of broad phase layers.
Definition Layers.cpp:24
virtual JPH::BroadPhaseLayer GetBroadPhaseLayer(JPH::ObjectLayer inLayer) const override
Get broad phase layer for object layer.
Definition Layers.cpp:27
BPLayerInterfaceImpl()
Create broad phase interface.
Definition Layers.cpp:23
static Layer * GetLayerByName(std::string name)
Get layer by name.
Definition Layers.cpp:15
Layer(std::string name, bool isStatic=false)
Create new physics layer.
Definition Layers.cpp:11
const bool isStatic
Whether objects are static.
Definition Layers.hpp:27
const JPH::ObjectLayer id
Unique layer ID.
Definition Layers.hpp:29
const JPH::BroadPhaseLayer BroadPhaseLayer
Broad phase settings.
Definition Layers.hpp:30
static Layer * GetLayerById(JPH::ObjectLayer id)
Get layer by ID.
Definition Layers.cpp:18
const std::string name
Layer name.
Definition Layers.hpp:28
Filter for object layer collisions.
Definition Layers.hpp:110
virtual bool ShouldCollide(JPH::ObjectLayer inObject1, JPH::ObjectLayer inObject2) const override
Check if layers should collide.
Definition Layers.cpp:38
Filter for broad phase layer collisions.
Definition Layers.hpp:93
virtual bool ShouldCollide(JPH::ObjectLayer inLayer1, JPH::BroadPhaseLayer inLayer2) const override
Check if layers should collide.
Definition Layers.cpp:30