diff --git a/SDK/src/NDK/Systems/VelocitySystem.cpp b/SDK/src/NDK/Systems/VelocitySystem.cpp index 4bc3b3a68..bc8042cd7 100644 --- a/SDK/src/NDK/Systems/VelocitySystem.cpp +++ b/SDK/src/NDK/Systems/VelocitySystem.cpp @@ -4,6 +4,7 @@ #include #include +#include #include #include @@ -14,8 +15,8 @@ namespace Ndk * \class Ndk::VelocitySystem * \brief NDK class that represents the velocity system * - * \remark This system is enabled if the entity owns the trait: NodeComponent and VelocityComponent - * but it's disabled with the trait: PhysicsComponent3D + * \remark This system is enabled if the entity owns the traits NodeComponent and VelocityComponent + * but it's disabled with the traits: PhysicsComponent2D, PhysicsComponent3D */ /*! @@ -24,7 +25,7 @@ namespace Ndk VelocitySystem::VelocitySystem() { - Excludes(); + Excludes(); Requires(); SetUpdateOrder(10); //< Since some systems may want to stop us } diff --git a/include/Nazara/Graphics/ParticleGroup.hpp b/include/Nazara/Graphics/ParticleGroup.hpp index 35feaa674..460694160 100644 --- a/include/Nazara/Graphics/ParticleGroup.hpp +++ b/include/Nazara/Graphics/ParticleGroup.hpp @@ -44,6 +44,8 @@ namespace Nz void* GenerateParticle(); void* GenerateParticles(unsigned int count); + inline void* GetBuffer(); + inline const void* GetBuffer() const; const ParticleDeclarationConstRef& GetDeclaration() const; std::size_t GetMaxParticleCount() const; std::size_t GetParticleCount() const; @@ -94,4 +96,6 @@ namespace Nz }; } +#include + #endif // NAZARA_PARTICLEGROUP_HPP diff --git a/include/Nazara/Graphics/ParticleGroup.inl b/include/Nazara/Graphics/ParticleGroup.inl new file mode 100644 index 000000000..f0e205346 --- /dev/null +++ b/include/Nazara/Graphics/ParticleGroup.inl @@ -0,0 +1,40 @@ +// Copyright (C) 2016 Jérôme Leclercq +// This file is part of the "Nazara Engine - Graphics module" +// For conditions of distribution and use, see copyright notice in Config.hpp + +#include +#include +#include + +namespace Nz +{ + /*! + * \brief Gets a raw pointer to the particle buffer + * + * This can be useful when working directly with a struct, or needing to iterate over all particles. + * + * \return Pointer to the buffer + * + * \see GetParticleCount + */ + inline void* ParticleGroup::GetBuffer() + { + return m_buffer.data(); + } + + /*! + * \brief Gets a raw pointer to the particle buffer + * + * This can be useful when working directly with a struct, or needing to iterate over all particles. + * + * \return Pointer to the buffer + * + * \see GetParticleCount + */ + inline const void* ParticleGroup::GetBuffer() const + { + return m_buffer.data(); + } +} + +#include diff --git a/include/Nazara/Graphics/ParticleMapper.hpp b/include/Nazara/Graphics/ParticleMapper.hpp index e66b519a7..ffbe2a5ad 100644 --- a/include/Nazara/Graphics/ParticleMapper.hpp +++ b/include/Nazara/Graphics/ParticleMapper.hpp @@ -22,6 +22,7 @@ namespace Nz template SparsePtr GetComponentPtr(ParticleComponent component); template SparsePtr GetComponentPtr(ParticleComponent component) const; + inline void* GetPointer(); private: const ParticleDeclaration* m_declaration; diff --git a/include/Nazara/Graphics/ParticleMapper.inl b/include/Nazara/Graphics/ParticleMapper.inl index 7d33bb655..1a4566c33 100644 --- a/include/Nazara/Graphics/ParticleMapper.inl +++ b/include/Nazara/Graphics/ParticleMapper.inl @@ -68,6 +68,18 @@ namespace Nz return SparsePtr(); } } + + /*! + * \brief Gets a raw pointer to the particle buffer + * + * This can be useful when working directly with a struct + * + * \return Pointer to the buffer + */ + inline void* ParticleMapper::GetPointer() + { + return m_ptr; + } } #include diff --git a/include/Nazara/Graphics/ParticleStruct.hpp b/include/Nazara/Graphics/ParticleStruct.hpp index 895e8fca2..b4f55a3a1 100644 --- a/include/Nazara/Graphics/ParticleStruct.hpp +++ b/include/Nazara/Graphics/ParticleStruct.hpp @@ -21,16 +21,16 @@ namespace Nz Vector3f normal; Vector3f position; Vector3f velocity; - UInt32 life; + float life; float rotation; }; struct ParticleStruct_Model { + Quaternionf rotation; Vector3f position; Vector3f velocity; - UInt32 life; - Quaternionf rotation; + float life; }; struct ParticleStruct_Sprite @@ -38,7 +38,7 @@ namespace Nz Color color; Vector3f position; Vector3f velocity; - UInt32 life; + float life; float rotation; }; }