Relaxed constant access
Former-commit-id: 885a7f065ccf9ff1fdbef23c88b852bb2e48fac7
This commit is contained in:
parent
3080ed8a43
commit
09e0ab898d
|
|
@ -28,13 +28,13 @@ class NAZARA_API NzModel : public NzSceneNode
|
|||
NzModel(const NzModel& model);
|
||||
~NzModel();
|
||||
|
||||
const NzAnimation* GetAnimation() const;
|
||||
NzAnimation* GetAnimation() const;
|
||||
const NzAxisAlignedBox& GetAABB() const;
|
||||
const NzMaterial* GetMaterial(unsigned int matIndex) const;
|
||||
const NzMaterial* GetMaterial(unsigned int skinIndex, unsigned int matIndex) const;
|
||||
NzMaterial* GetMaterial(unsigned int matIndex) const;
|
||||
NzMaterial* GetMaterial(unsigned int skinIndex, unsigned int matIndex) const;
|
||||
unsigned int GetMaterialCount() const;
|
||||
unsigned int GetSkinCount() const;
|
||||
const NzMesh* GetMesh() const;
|
||||
NzMesh* GetMesh() const;
|
||||
nzSceneNodeType GetSceneNodeType() const override;
|
||||
NzSkeleton* GetSkeleton();
|
||||
const NzSkeleton* GetSkeleton() const;
|
||||
|
|
@ -47,10 +47,10 @@ class NAZARA_API NzModel : public NzSceneNode
|
|||
|
||||
void Reset();
|
||||
|
||||
bool SetAnimation(const NzAnimation* animation);
|
||||
void SetMaterial(unsigned int matIndex, const NzMaterial* material);
|
||||
void SetMaterial(unsigned int skinIndex, unsigned int matIndex, const NzMaterial* material);
|
||||
void SetMesh(const NzMesh* mesh, const NzModelParameters& parameters = NzModelParameters());
|
||||
bool SetAnimation(NzAnimation* animation);
|
||||
void SetMaterial(unsigned int matIndex, NzMaterial* material);
|
||||
void SetMaterial(unsigned int skinIndex, unsigned int matIndex, NzMaterial* material);
|
||||
void SetMesh(NzMesh* mesh, const NzModelParameters& parameters = NzModelParameters());
|
||||
void SetSkinCount(unsigned int skinCount);
|
||||
bool SetSequence(const NzString& sequenceName);
|
||||
void SetSequence(unsigned int sequenceIndex);
|
||||
|
|
@ -58,10 +58,10 @@ class NAZARA_API NzModel : public NzSceneNode
|
|||
void Update(float elapsedTime);
|
||||
|
||||
private:
|
||||
std::vector<const NzMaterial*> m_materials;
|
||||
std::vector<NzMaterial*> m_materials;
|
||||
NzSkeleton m_skeleton; // Uniquement pour les animations squelettiques
|
||||
const NzAnimation* m_animation;
|
||||
const NzMesh* m_mesh;
|
||||
NzAnimation* m_animation;
|
||||
NzMesh* m_mesh;
|
||||
const NzSequence* m_currentSequence;
|
||||
float m_interpolation;
|
||||
unsigned int m_currentFrame;
|
||||
|
|
|
|||
|
|
@ -46,18 +46,18 @@ class NAZARA_API NzMaterial : public NzResource
|
|||
|
||||
NzColor GetAmbientColor() const;
|
||||
NzColor GetDiffuseColor() const;
|
||||
const NzTexture* GetDiffuseMap() const;
|
||||
NzTexture* GetDiffuseMap() const;
|
||||
NzTextureSampler& GetDiffuseSampler();
|
||||
const NzTextureSampler& GetDiffuseSampler() const;
|
||||
nzBlendFunc GetDstBlend() const;
|
||||
nzFaceCulling GetFaceCulling() const;
|
||||
nzFaceFilling GetFaceFilling() const;
|
||||
const NzTexture* GetHeightMap() const;
|
||||
const NzTexture* GetNormalMap() const;
|
||||
NzTexture* GetHeightMap() const;
|
||||
NzTexture* GetNormalMap() const;
|
||||
const NzShader* GetShader() const;
|
||||
float GetShininess() const;
|
||||
NzColor GetSpecularColor() const;
|
||||
const NzTexture* GetSpecularMap() const;
|
||||
NzTexture* GetSpecularMap() const;
|
||||
NzTextureSampler& GetSpecularSampler();
|
||||
const NzTextureSampler& GetSpecularSampler() const;
|
||||
nzBlendFunc GetSrcBlend() const;
|
||||
|
|
@ -76,17 +76,17 @@ class NAZARA_API NzMaterial : public NzResource
|
|||
|
||||
void SetAmbientColor(const NzColor& ambient);
|
||||
void SetDiffuseColor(const NzColor& diffuse);
|
||||
void SetDiffuseMap(const NzTexture* map);
|
||||
void SetDiffuseMap(NzTexture* map);
|
||||
void SetDiffuseSampler(const NzTextureSampler& sampler);
|
||||
void SetDstBlend(nzBlendFunc func);
|
||||
void SetFaceCulling(nzFaceCulling culling);
|
||||
void SetFaceFilling(nzFaceFilling filling);
|
||||
void SetHeightMap(const NzTexture* map);
|
||||
void SetNormalMap(const NzTexture* map);
|
||||
void SetHeightMap(NzTexture* map);
|
||||
void SetNormalMap(NzTexture* map);
|
||||
void SetShader(const NzShader* shader);
|
||||
void SetShininess(float shininess);
|
||||
void SetSpecularColor(const NzColor& specular);
|
||||
void SetSpecularMap(const NzTexture* map);
|
||||
void SetSpecularMap(NzTexture* map);
|
||||
void SetSpecularSampler(const NzTextureSampler& sampler);
|
||||
void SetSrcBlend(nzBlendFunc func);
|
||||
void SetZTestCompare(nzRendererComparison compareFunc);
|
||||
|
|
@ -94,7 +94,7 @@ class NAZARA_API NzMaterial : public NzResource
|
|||
NzMaterial& operator=(const NzMaterial& material);
|
||||
NzMaterial& operator=(NzMaterial&& material);
|
||||
|
||||
static const NzMaterial* GetDefault();
|
||||
static NzMaterial* GetDefault();
|
||||
|
||||
private:
|
||||
void UpdateShader() const;
|
||||
|
|
@ -110,10 +110,10 @@ class NAZARA_API NzMaterial : public NzResource
|
|||
NzTextureSampler m_diffuseSampler;
|
||||
NzTextureSampler m_specularSampler;
|
||||
mutable const NzShader* m_shader;
|
||||
const NzTexture* m_diffuseMap;
|
||||
const NzTexture* m_heightMap;
|
||||
const NzTexture* m_normalMap;
|
||||
const NzTexture* m_specularMap;
|
||||
NzTexture* m_diffuseMap;
|
||||
NzTexture* m_heightMap;
|
||||
NzTexture* m_normalMap;
|
||||
NzTexture* m_specularMap;
|
||||
bool m_alphaBlendingEnabled;
|
||||
bool m_autoShader;
|
||||
bool m_lightingEnabled;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ NzModel::~NzModel()
|
|||
Reset();
|
||||
}
|
||||
|
||||
const NzAnimation* NzModel::GetAnimation() const
|
||||
NzAnimation* NzModel::GetAnimation() const
|
||||
{
|
||||
return m_animation;
|
||||
}
|
||||
|
|
@ -60,7 +60,7 @@ const NzAxisAlignedBox& NzModel::GetAABB() const
|
|||
return m_mesh->GetAABB();
|
||||
}
|
||||
|
||||
const NzMaterial* NzModel::GetMaterial(unsigned int matIndex) const
|
||||
NzMaterial* NzModel::GetMaterial(unsigned int matIndex) const
|
||||
{
|
||||
#if NAZARA_3D_SAFE
|
||||
if (matIndex >= m_matCount)
|
||||
|
|
@ -73,7 +73,7 @@ const NzMaterial* NzModel::GetMaterial(unsigned int matIndex) const
|
|||
return m_materials[matIndex];
|
||||
}
|
||||
|
||||
const NzMaterial* NzModel::GetMaterial(unsigned int skinIndex, unsigned int matIndex) const
|
||||
NzMaterial* NzModel::GetMaterial(unsigned int skinIndex, unsigned int matIndex) const
|
||||
{
|
||||
#if NAZARA_3D_SAFE
|
||||
if (skinIndex >= m_skinCount)
|
||||
|
|
@ -102,7 +102,7 @@ unsigned int NzModel::GetSkinCount() const
|
|||
return m_skinCount;
|
||||
}
|
||||
|
||||
const NzMesh* NzModel::GetMesh() const
|
||||
NzMesh* NzModel::GetMesh() const
|
||||
{
|
||||
return m_mesh;
|
||||
}
|
||||
|
|
@ -199,7 +199,7 @@ void NzModel::Reset()
|
|||
}
|
||||
}
|
||||
|
||||
bool NzModel::SetAnimation(const NzAnimation* animation)
|
||||
bool NzModel::SetAnimation(NzAnimation* animation)
|
||||
{
|
||||
#if NAZARA_3D_SAFE
|
||||
if (!m_mesh)
|
||||
|
|
@ -243,7 +243,7 @@ bool NzModel::SetAnimation(const NzAnimation* animation)
|
|||
return true;
|
||||
}
|
||||
|
||||
void NzModel::SetMaterial(unsigned int matIndex, const NzMaterial* material)
|
||||
void NzModel::SetMaterial(unsigned int matIndex, NzMaterial* material)
|
||||
{
|
||||
#if NAZARA_3D_SAFE
|
||||
if (matIndex >= m_matCount)
|
||||
|
|
@ -263,7 +263,7 @@ void NzModel::SetMaterial(unsigned int matIndex, const NzMaterial* material)
|
|||
m_materials[matIndex]->AddResourceReference();
|
||||
}
|
||||
|
||||
void NzModel::SetMaterial(unsigned int skinIndex, unsigned int matIndex, const NzMaterial* material)
|
||||
void NzModel::SetMaterial(unsigned int skinIndex, unsigned int matIndex, NzMaterial* material)
|
||||
{
|
||||
#if NAZARA_3D_SAFE
|
||||
if (skinIndex >= m_skinCount)
|
||||
|
|
@ -291,7 +291,7 @@ void NzModel::SetMaterial(unsigned int skinIndex, unsigned int matIndex, const N
|
|||
m_materials[index]->AddResourceReference();
|
||||
}
|
||||
|
||||
void NzModel::SetMesh(const NzMesh* mesh, const NzModelParameters& modelParameters)
|
||||
void NzModel::SetMesh(NzMesh* mesh, const NzModelParameters& modelParameters)
|
||||
{
|
||||
Reset();
|
||||
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ const NzTextureSampler& NzMaterial::GetDiffuseSampler() const
|
|||
return m_diffuseSampler;
|
||||
}
|
||||
|
||||
const NzTexture* NzMaterial::GetDiffuseMap() const
|
||||
NzTexture* NzMaterial::GetDiffuseMap() const
|
||||
{
|
||||
return m_diffuseMap;
|
||||
}
|
||||
|
|
@ -237,12 +237,12 @@ nzFaceFilling NzMaterial::GetFaceFilling() const
|
|||
return m_faceFilling;
|
||||
}
|
||||
|
||||
const NzTexture* NzMaterial::GetHeightMap() const
|
||||
NzTexture* NzMaterial::GetHeightMap() const
|
||||
{
|
||||
return m_diffuseMap;
|
||||
}
|
||||
|
||||
const NzTexture* NzMaterial::GetNormalMap() const
|
||||
NzTexture* NzMaterial::GetNormalMap() const
|
||||
{
|
||||
return m_diffuseMap;
|
||||
}
|
||||
|
|
@ -265,7 +265,7 @@ NzColor NzMaterial::GetSpecularColor() const
|
|||
return m_specularColor;
|
||||
}
|
||||
|
||||
const NzTexture* NzMaterial::GetSpecularMap() const
|
||||
NzTexture* NzMaterial::GetSpecularMap() const
|
||||
{
|
||||
return m_specularMap;
|
||||
}
|
||||
|
|
@ -385,7 +385,7 @@ void NzMaterial::SetDiffuseColor(const NzColor& diffuse)
|
|||
m_diffuseColor = diffuse;
|
||||
}
|
||||
|
||||
void NzMaterial::SetDiffuseMap(const NzTexture* map)
|
||||
void NzMaterial::SetDiffuseMap(NzTexture* map)
|
||||
{
|
||||
if (m_diffuseMap)
|
||||
m_diffuseMap->RemoveResourceReference();
|
||||
|
|
@ -415,7 +415,7 @@ void NzMaterial::SetFaceFilling(nzFaceFilling filling)
|
|||
m_faceFilling = filling;
|
||||
}
|
||||
|
||||
void NzMaterial::SetHeightMap(const NzTexture* map)
|
||||
void NzMaterial::SetHeightMap(NzTexture* map)
|
||||
{
|
||||
if (m_heightMap)
|
||||
m_heightMap->RemoveResourceReference();
|
||||
|
|
@ -425,7 +425,7 @@ void NzMaterial::SetHeightMap(const NzTexture* map)
|
|||
m_heightMap->AddResourceReference();
|
||||
}
|
||||
|
||||
void NzMaterial::SetNormalMap(const NzTexture* map)
|
||||
void NzMaterial::SetNormalMap(NzTexture* map)
|
||||
{
|
||||
if (m_normalMap)
|
||||
m_normalMap->RemoveResourceReference();
|
||||
|
|
@ -456,7 +456,7 @@ void NzMaterial::SetSpecularColor(const NzColor& specular)
|
|||
m_specularColor = specular;
|
||||
}
|
||||
|
||||
void NzMaterial::SetSpecularMap(const NzTexture* map)
|
||||
void NzMaterial::SetSpecularMap(NzTexture* map)
|
||||
{
|
||||
if (m_specularMap)
|
||||
m_specularMap->RemoveResourceReference();
|
||||
|
|
@ -545,7 +545,7 @@ NzMaterial& NzMaterial::operator=(NzMaterial&& material)
|
|||
return *this;
|
||||
}
|
||||
|
||||
const NzMaterial* NzMaterial::GetDefault()
|
||||
NzMaterial* NzMaterial::GetDefault()
|
||||
{
|
||||
static NzMaterial defaultMaterial;
|
||||
static bool initialized = false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue