SDK/Systems: Disable VelocitySystem if PhysicsComponent2D is present
This commit is contained in:
parent
24e0163a8a
commit
88895df1d0
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#include <NDK/Systems/VelocitySystem.hpp>
|
#include <NDK/Systems/VelocitySystem.hpp>
|
||||||
#include <NDK/Components/NodeComponent.hpp>
|
#include <NDK/Components/NodeComponent.hpp>
|
||||||
|
#include <NDK/Components/PhysicsComponent2D.hpp>
|
||||||
#include <NDK/Components/PhysicsComponent3D.hpp>
|
#include <NDK/Components/PhysicsComponent3D.hpp>
|
||||||
#include <NDK/Components/VelocityComponent.hpp>
|
#include <NDK/Components/VelocityComponent.hpp>
|
||||||
|
|
||||||
|
|
@ -14,8 +15,8 @@ namespace Ndk
|
||||||
* \class Ndk::VelocitySystem
|
* \class Ndk::VelocitySystem
|
||||||
* \brief NDK class that represents the velocity system
|
* \brief NDK class that represents the velocity system
|
||||||
*
|
*
|
||||||
* \remark This system is enabled if the entity owns the trait: NodeComponent and VelocityComponent
|
* \remark This system is enabled if the entity owns the traits NodeComponent and VelocityComponent
|
||||||
* but it's disabled with the trait: PhysicsComponent3D
|
* but it's disabled with the traits: PhysicsComponent2D, PhysicsComponent3D
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
@ -24,7 +25,7 @@ namespace Ndk
|
||||||
|
|
||||||
VelocitySystem::VelocitySystem()
|
VelocitySystem::VelocitySystem()
|
||||||
{
|
{
|
||||||
Excludes<PhysicsComponent3D>();
|
Excludes<PhysicsComponent2D, PhysicsComponent3D>();
|
||||||
Requires<NodeComponent, VelocityComponent>();
|
Requires<NodeComponent, VelocityComponent>();
|
||||||
SetUpdateOrder(10); //< Since some systems may want to stop us
|
SetUpdateOrder(10); //< Since some systems may want to stop us
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue