Ndk/Physics: Added first physics components/systems
Former-commit-id: 654b7a2a4645487d139474dcbd02c0882d7c8f02
This commit is contained in:
36
SDK/include/NDK/Systems/PhysicsSystem.hpp
Normal file
36
SDK/include/NDK/Systems/PhysicsSystem.hpp
Normal file
@@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2015 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Development Kit"
|
||||
// For conditions of distribution and use, see copyright notice in Prerequesites.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NDK_SYSTEMS_PHYSICSSYSTEM_HPP
|
||||
#define NDK_SYSTEMS_PHYSICSSYSTEM_HPP
|
||||
|
||||
#include <Nazara/Physics/PhysWorld.hpp>
|
||||
#include <NDK/System.hpp>
|
||||
|
||||
namespace Ndk
|
||||
{
|
||||
class NDK_API PhysicsSystem : public System<PhysicsSystem>
|
||||
{
|
||||
public:
|
||||
PhysicsSystem();
|
||||
PhysicsSystem(const PhysicsSystem& system);
|
||||
~PhysicsSystem() = default;
|
||||
|
||||
NzPhysWorld& GetWorld();
|
||||
const NzPhysWorld& GetWorld() const;
|
||||
|
||||
void Update(float elapsedTime);
|
||||
|
||||
static SystemIndex systemIndex;
|
||||
|
||||
private:
|
||||
NzPhysWorld m_world;
|
||||
};
|
||||
}
|
||||
|
||||
#include <NDK/Systems/PhysicsSystem.inl>
|
||||
|
||||
#endif // NDK_SYSTEMS_PHYSICSSYSTEM_HPP
|
||||
16
SDK/include/NDK/Systems/PhysicsSystem.inl
Normal file
16
SDK/include/NDK/Systems/PhysicsSystem.inl
Normal file
@@ -0,0 +1,16 @@
|
||||
// Copyright (C) 2015 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Development Kit"
|
||||
// For conditions of distribution and use, see copyright notice in Prerequesites.hpp
|
||||
|
||||
namespace Ndk
|
||||
{
|
||||
inline NzPhysWorld& PhysicsSystem::GetWorld()
|
||||
{
|
||||
return m_world;
|
||||
}
|
||||
|
||||
inline const NzPhysWorld& PhysicsSystem::GetWorld() const
|
||||
{
|
||||
return m_world;
|
||||
}
|
||||
}
|
||||
29
SDK/include/NDK/Systems/StaticCollisionSystem.hpp
Normal file
29
SDK/include/NDK/Systems/StaticCollisionSystem.hpp
Normal file
@@ -0,0 +1,29 @@
|
||||
// Copyright (C) 2015 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Development Kit"
|
||||
// For conditions of distribution and use, see copyright notice in Prerequesites.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NDK_SYSTEMS_STATICCOLLISIONSYSTEM_HPP
|
||||
#define NDK_SYSTEMS_STATICCOLLISIONSYSTEM_HPP
|
||||
|
||||
#include <NDK/System.hpp>
|
||||
|
||||
namespace Ndk
|
||||
{
|
||||
class NDK_API StaticCollisionSystem : public System<StaticCollisionSystem>
|
||||
{
|
||||
public:
|
||||
StaticCollisionSystem();
|
||||
StaticCollisionSystem(const StaticCollisionSystem& system) = default;
|
||||
~StaticCollisionSystem() = default;
|
||||
|
||||
void Update(float elapsedTime);
|
||||
|
||||
static SystemIndex systemIndex;
|
||||
};
|
||||
}
|
||||
|
||||
#include <NDK/Systems/StaticCollisionSystem.inl>
|
||||
|
||||
#endif // NDK_SYSTEMS_STATICCOLLISIONSYSTEM_HPP
|
||||
7
SDK/include/NDK/Systems/StaticCollisionSystem.inl
Normal file
7
SDK/include/NDK/Systems/StaticCollisionSystem.inl
Normal file
@@ -0,0 +1,7 @@
|
||||
// Copyright (C) 2015 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Development Kit"
|
||||
// For conditions of distribution and use, see copyright notice in Prerequesites.hpp
|
||||
|
||||
namespace Ndk
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user