Physics3D: Ensure RigidBody are destroyed on world destruction
This commit is contained in:
@@ -14,6 +14,8 @@ namespace Nz
|
||||
{
|
||||
class NAZARA_PHYSICS3D_API RigidBody3DComponent : public RigidBody3D
|
||||
{
|
||||
friend class Physics3DSystem;
|
||||
|
||||
public:
|
||||
using RigidBody3D::RigidBody3D;
|
||||
RigidBody3DComponent(const RigidBody3DComponent&) = default;
|
||||
|
||||
@@ -77,6 +77,9 @@ namespace Nz
|
||||
RigidBody3D& operator=(const RigidBody3D& object);
|
||||
RigidBody3D& operator=(RigidBody3D&& object) noexcept;
|
||||
|
||||
protected:
|
||||
void Destroy();
|
||||
|
||||
private:
|
||||
void UpdateBody(const Matrix4f& transformMatrix);
|
||||
static void ForceAndTorqueCallback(const NewtonBody* body, float timeStep, int threadIndex);
|
||||
|
||||
@@ -35,6 +35,7 @@ namespace Nz
|
||||
private:
|
||||
static void OnConstruct(entt::registry& registry, entt::entity entity);
|
||||
|
||||
entt::registry& m_registry;
|
||||
entt::connection m_constructConnection;
|
||||
PhysWorld3D m_physWorld;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user