Continue Jolt integration

This commit is contained in:
SirLynix
2023-03-21 13:31:52 +01:00
committed by Jérôme Leclercq
parent 21e08798ce
commit 021801f02e
35 changed files with 612 additions and 214 deletions

View File

@@ -0,0 +1,31 @@
// Copyright (C) 2023 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
// This file is part of the "Nazara Engine - JoltPhysics3D module"
// For conditions of distribution and use, see copyright notice in Config.hpp
#include <Nazara/JoltPhysics3D/Debug.hpp>
namespace Nz
{
inline bool JoltPhysWorld3D::IsBodyActive(UInt32 bodyIndex) const
{
UInt32 blockIndex = bodyIndex / 64;
UInt32 localIndex = bodyIndex % 64;
return m_activeBodies[blockIndex] & (UInt64(1u) << localIndex);
}
inline void JoltPhysWorld3D::RegisterCharacter(JoltCharacter* character)
{
auto it = std::lower_bound(m_characters.begin(), m_characters.end(), character);
m_characters.insert(it, character);
}
inline void JoltPhysWorld3D::UnregisterCharacter(JoltCharacter* character)
{
auto it = std::lower_bound(m_characters.begin(), m_characters.end(), character);
assert(*it == character);
m_characters.erase(it);
}
}
#include <Nazara/JoltPhysics3D/DebugOff.hpp>