Removed [*]RenderQueue::AddModel
Former-commit-id: 74b3e2b59b7a2ced16edca8dd7027dd8ae1db861
This commit is contained in:
parent
2c3d8ee5f4
commit
0ca2c9ccb2
|
|
@ -26,7 +26,6 @@ class NAZARA_API NzAbstractRenderQueue : NzNonCopyable
|
|||
|
||||
virtual void AddDrawable(const NzDrawable* drawable) = 0;
|
||||
virtual void AddLight(const NzLight* light) = 0;
|
||||
virtual void AddModel(const NzModel* model) = 0;
|
||||
virtual void AddSprite(const NzSprite* sprite) = 0;
|
||||
virtual void AddSubMesh(const NzMaterial* material, const NzSubMesh* subMesh, const NzMatrix4f& transformMatrix) = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -27,11 +27,10 @@ class NAZARA_API NzDeferredRenderQueue : public NzAbstractRenderQueue, NzResourc
|
|||
NzDeferredRenderQueue(NzForwardRenderQueue* forwardQueue);
|
||||
~NzDeferredRenderQueue();
|
||||
|
||||
void AddDrawable(const NzDrawable* drawable);
|
||||
void AddLight(const NzLight* light);
|
||||
void AddModel(const NzModel* model);
|
||||
void AddSprite(const NzSprite* sprite);
|
||||
void AddSubMesh(const NzMaterial* material, const NzSubMesh* subMesh, const NzMatrix4f& transformMatrix);
|
||||
void AddDrawable(const NzDrawable* drawable) override;
|
||||
void AddLight(const NzLight* light) override;
|
||||
void AddSprite(const NzSprite* sprite) override;
|
||||
void AddSubMesh(const NzMaterial* material, const NzSubMesh* subMesh, const NzMatrix4f& transformMatrix) override;
|
||||
|
||||
void Clear(bool fully);
|
||||
|
||||
|
|
|
|||
|
|
@ -29,11 +29,10 @@ class NAZARA_API NzForwardRenderQueue : public NzAbstractRenderQueue, NzResource
|
|||
NzForwardRenderQueue() = default;
|
||||
~NzForwardRenderQueue();
|
||||
|
||||
void AddDrawable(const NzDrawable* drawable);
|
||||
void AddLight(const NzLight* light);
|
||||
void AddModel(const NzModel* model);
|
||||
void AddSprite(const NzSprite* sprite);
|
||||
void AddSubMesh(const NzMaterial* material, const NzSubMesh* subMesh, const NzMatrix4f& transformMatrix);
|
||||
void AddDrawable(const NzDrawable* drawable) override;
|
||||
void AddLight(const NzLight* light) override;
|
||||
void AddSprite(const NzSprite* sprite) override;
|
||||
void AddSubMesh(const NzMaterial* material, const NzSubMesh* subMesh, const NzMatrix4f& transformMatrix) override;
|
||||
|
||||
void Clear(bool fully);
|
||||
|
||||
|
|
|
|||
|
|
@ -66,36 +66,6 @@ void NzDeferredRenderQueue::AddLight(const NzLight* light)
|
|||
m_forwardQueue->AddLight(light);
|
||||
}
|
||||
|
||||
void NzDeferredRenderQueue::AddModel(const NzModel* model)
|
||||
{
|
||||
#if NAZARA_GRAPHICS_SAFE
|
||||
if (!model)
|
||||
{
|
||||
NazaraError("Invalid model");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!model->IsDrawable())
|
||||
{
|
||||
NazaraError("Model is not drawable");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
const NzMatrix4f& transformMatrix = model->GetTransformMatrix();
|
||||
|
||||
NzMesh* mesh = model->GetMesh();
|
||||
unsigned int submeshCount = mesh->GetSubMeshCount();
|
||||
|
||||
for (unsigned int i = 0; i < submeshCount; ++i)
|
||||
{
|
||||
NzSubMesh* subMesh = mesh->GetSubMesh(i);
|
||||
NzMaterial* material = model->GetMaterial(subMesh->GetMaterialIndex());
|
||||
|
||||
AddSubMesh(material, subMesh, transformMatrix);
|
||||
}
|
||||
}
|
||||
|
||||
void NzDeferredRenderQueue::AddSprite(const NzSprite* sprite)
|
||||
{
|
||||
#if NAZARA_GRAPHICS_SAFE
|
||||
|
|
|
|||
|
|
@ -68,36 +68,6 @@ void NzForwardRenderQueue::AddLight(const NzLight* light)
|
|||
}
|
||||
}
|
||||
|
||||
void NzForwardRenderQueue::AddModel(const NzModel* model)
|
||||
{
|
||||
#if NAZARA_GRAPHICS_SAFE
|
||||
if (!model)
|
||||
{
|
||||
NazaraError("Invalid model");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!model->IsDrawable())
|
||||
{
|
||||
NazaraError("Model is not drawable");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
const NzMatrix4f& transformMatrix = model->GetTransformMatrix();
|
||||
|
||||
NzMesh* mesh = model->GetMesh();
|
||||
unsigned int submeshCount = mesh->GetSubMeshCount();
|
||||
|
||||
for (unsigned int i = 0; i < submeshCount; ++i)
|
||||
{
|
||||
NzSubMesh* subMesh = mesh->GetSubMesh(i);
|
||||
NzMaterial* material = model->GetMaterial(subMesh->GetMaterialIndex());
|
||||
|
||||
AddSubMesh(material, subMesh, transformMatrix);
|
||||
}
|
||||
}
|
||||
|
||||
void NzForwardRenderQueue::AddSprite(const NzSprite* sprite)
|
||||
{
|
||||
#if NAZARA_GRAPHICS_SAFE
|
||||
|
|
|
|||
|
|
@ -72,7 +72,16 @@ NzModel::~NzModel()
|
|||
|
||||
void NzModel::AddToRenderQueue(NzAbstractRenderQueue* renderQueue) const
|
||||
{
|
||||
renderQueue->AddModel(this);
|
||||
const NzMatrix4f& transformMatrix = GetTransformMatrix();
|
||||
|
||||
unsigned int submeshCount = m_mesh->GetSubMeshCount();
|
||||
for (unsigned int i = 0; i < submeshCount; ++i)
|
||||
{
|
||||
NzSubMesh* subMesh = m_mesh->GetSubMesh(i);
|
||||
NzMaterial* material = m_materials[subMesh->GetMaterialIndex()];
|
||||
|
||||
renderQueue->AddSubMesh(material, subMesh, transformMatrix);
|
||||
}
|
||||
}
|
||||
|
||||
void NzModel::AdvanceAnimation(float elapsedTime)
|
||||
|
|
|
|||
Loading…
Reference in New Issue