Merge remote-tracking branch 'refs/remotes/origin/master' into culling

This commit is contained in:
Lynix
2016-11-23 14:12:46 +01:00
6 changed files with 65 additions and 7 deletions

View File

@@ -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 <Nazara/Graphics/ParticleGroup.inl>
#endif // NAZARA_PARTICLEGROUP_HPP

View File

@@ -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 <Nazara/Graphics/ParticleGroup.hpp>
#include <Nazara/Core/Error.hpp>
#include <Nazara/Graphics/Debug.hpp>
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 <Nazara/Graphics/DebugOff.hpp>

View File

@@ -22,6 +22,7 @@ namespace Nz
template<typename T> SparsePtr<T> GetComponentPtr(ParticleComponent component);
template<typename T> SparsePtr<const T> GetComponentPtr(ParticleComponent component) const;
inline void* GetPointer();
private:
const ParticleDeclaration* m_declaration;

View File

@@ -68,6 +68,18 @@ namespace Nz
return SparsePtr<const T>();
}
}
/*!
* \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 <Nazara/Graphics/DebugOff.hpp>

View File

@@ -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;
};
}