Skip to content

Commit

Permalink
dynamics: Fix up namespacing for RigidBodyType
Browse files Browse the repository at this point in the history
  • Loading branch information
bwrsandman committed Apr 1, 2024
1 parent 6e11056 commit 306868d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/Debug/Console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,14 @@ void Console::Draw(Game& game)
{
switch (hit->second.type)
{
case ecs::systems::RigidBodyType::Terrain:
case RigidBodyType::Terrain:
{
// auto landIsland = reinterpret_cast<const LandIsland*>(hit->second.userData);
auto blockIndex = hit->second.id;
ImGui::SetTooltip("Block Index: %d", blockIndex);
}
break;
case ecs::systems::RigidBodyType::Entity:
case RigidBodyType::Entity:
{
// auto registry = reinterpret_cast<const openblack::ecs::Registry*>(hit->second.userData);
auto entity = hit->second.id;
Expand Down
7 changes: 4 additions & 3 deletions src/ECS/Systems/DynamicsSystemInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ namespace ecs::components
{
struct Transform;
}
} // namespace openblack

namespace openblack::ecs::systems
{
enum class RigidBodyType
{
Terrain,
Expand All @@ -41,6 +38,10 @@ struct RigidBodyDetails
const void* userData;
};

} // namespace openblack

namespace openblack::ecs::systems
{
class DynamicsSystemInterface
{
public:
Expand Down
4 changes: 2 additions & 2 deletions src/ECS/Systems/Implementations/DynamicsSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void DynamicsSystem::RegisterRigidBodies()
{
auto& registry = Locator::entitiesRegistry::value();
registry.Each<RigidBody>([this](RigidBody& body) {
body.handle.setUserIndex(static_cast<int>(ecs::systems::RigidBodyType::Entity));
body.handle.setUserIndex(static_cast<int>(RigidBodyType::Entity));
body.handle.setUserIndex2(0);
body.handle.setUserPointer(this);
AddRigidBody(&body.handle);
Expand All @@ -92,7 +92,7 @@ void DynamicsSystem::RegisterIslandRigidBodies(LandIslandInterface& island)
for (uint32_t i = 0; i < landBlocks.size(); ++i)
{
auto& rigidBody = landBlocks[i].GetRigidBody();
rigidBody->setUserIndex(static_cast<int>(ecs::systems::RigidBodyType::Terrain));
rigidBody->setUserIndex(static_cast<int>(RigidBodyType::Terrain));
rigidBody->setUserIndex2(i);
rigidBody->setUserPointer(reinterpret_cast<void*>(this));
AddRigidBody(rigidBody.get());
Expand Down

0 comments on commit 306868d

Please sign in to comment.