Cleaned interface

Former-commit-id: cdd284de8396d5988853c84d5db17bfa6fa0ba51
This commit is contained in:
Lynix 2013-06-09 22:05:05 +02:00
parent 0612e9bea5
commit 6b2af70f1d
8 changed files with 28 additions and 28 deletions

View File

@ -7,6 +7,14 @@
#ifndef NAZARA_ENUMS_CORE_HPP #ifndef NAZARA_ENUMS_CORE_HPP
#define NAZARA_ENUMS_CORE_HPP #define NAZARA_ENUMS_CORE_HPP
enum nzCoordSys
{
nzCoordSys_Global,
nzCoordSys_Local,
nzCoordSys_Max = nzCoordSys_Local
};
enum nzEndianness enum nzEndianness
{ {
nzEndianness_Unknown = -1, nzEndianness_Unknown = -1,

View File

@ -23,7 +23,7 @@ class NzBox
NzBox(T X, T Y, T Z, T Width, T Height, T Depth); NzBox(T X, T Y, T Z, T Width, T Height, T Depth);
NzBox(const T box[6]); NzBox(const T box[6]);
NzBox(const NzRect<T>& rect); NzBox(const NzRect<T>& rect);
NzBox(const NzVector3<T>& size); NzBox(const NzVector3<T>& lengths);
NzBox(const NzVector3<T>& vec1, const NzVector3<T>& vec2); NzBox(const NzVector3<T>& vec1, const NzVector3<T>& vec2);
template<typename U> explicit NzBox(const NzBox<U>& box); template<typename U> explicit NzBox(const NzBox<U>& box);
NzBox(const NzBox& box) = default; NzBox(const NzBox& box) = default;
@ -60,7 +60,7 @@ class NzBox
NzBox& Set(const T box[6]); NzBox& Set(const T box[6]);
NzBox& Set(const NzBox& box); NzBox& Set(const NzBox& box);
NzBox& Set(const NzRect<T>& rect); NzBox& Set(const NzRect<T>& rect);
NzBox& Set(const NzVector3<T>& size); NzBox& Set(const NzVector3<T>& lengths);
NzBox& Set(const NzVector3<T>& vec1, const NzVector3<T>& vec2); NzBox& Set(const NzVector3<T>& vec1, const NzVector3<T>& vec2);
template<typename U> NzBox& Set(const NzBox<U>& box); template<typename U> NzBox& Set(const NzBox<U>& box);

View File

@ -29,9 +29,9 @@ NzBox<T>::NzBox(const NzRect<T>& rect)
} }
template<typename T> template<typename T>
NzBox<T>::NzBox(const NzVector3<T>& size) NzBox<T>::NzBox(const NzVector3<T>& lengths)
{ {
Set(size); Set(lengths);
} }
template<typename T> template<typename T>
@ -344,9 +344,9 @@ NzBox<T>& NzBox<T>::Set(const NzRect<T>& rect)
} }
template<typename T> template<typename T>
NzBox<T>& NzBox<T>::Set(const NzVector3<T>& size) NzBox<T>& NzBox<T>::Set(const NzVector3<T>& lengths)
{ {
return Set(size.x, size.y, size.z); return Set(lengths.x, lengths.y, lengths.z);
} }
template<typename T> template<typename T>

View File

@ -18,7 +18,7 @@ class NzRect
NzRect(T Width, T Height); NzRect(T Width, T Height);
NzRect(T X, T Y, T Width, T Height); NzRect(T X, T Y, T Width, T Height);
NzRect(const T rect[4]); NzRect(const T rect[4]);
NzRect(const NzVector2<T>& size); NzRect(const NzVector2<T>& lengths);
NzRect(const NzVector2<T>& vec1, const NzVector2<T>& vec2); NzRect(const NzVector2<T>& vec1, const NzVector2<T>& vec2);
template<typename U> explicit NzRect(const NzRect<U>& rect); template<typename U> explicit NzRect(const NzRect<U>& rect);
NzRect(const NzRect& rect) = default; NzRect(const NzRect& rect) = default;
@ -50,7 +50,7 @@ class NzRect
NzRect& Set(T X, T Y, T Width, T Height); NzRect& Set(T X, T Y, T Width, T Height);
NzRect& Set(const T rect[4]); NzRect& Set(const T rect[4]);
NzRect& Set(const NzRect<T>& rect); NzRect& Set(const NzRect<T>& rect);
NzRect& Set(const NzVector2<T>& size); NzRect& Set(const NzVector2<T>& lengths);
NzRect& Set(const NzVector2<T>& vec1, const NzVector2<T>& vec2); NzRect& Set(const NzVector2<T>& vec1, const NzVector2<T>& vec2);
template<typename U> NzRect& Set(const NzRect<U>& rect); template<typename U> NzRect& Set(const NzRect<U>& rect);

View File

@ -29,9 +29,9 @@ NzRect<T>::NzRect(const T vec[4])
} }
template<typename T> template<typename T>
NzRect<T>::NzRect(const NzVector2<T>& size) NzRect<T>::NzRect(const NzVector2<T>& lengths)
{ {
Set(size); Set(lengths);
} }
template<typename T> template<typename T>
@ -245,9 +245,9 @@ NzRect<T>& NzRect<T>::Set(const NzRect<T>& rect)
} }
template<typename T> template<typename T>
NzRect<T>& NzRect<T>::Set(const NzVector2<T>& size) NzRect<T>& NzRect<T>::Set(const NzVector2<T>& lengths)
{ {
return Set(size.x, size.y); return Set(lengths.x, lengths.y);
} }
template<typename T> template<typename T>

View File

@ -50,14 +50,6 @@ enum nzBufferUsage
nzBufferUsage_Max = nzBufferUsage_Static nzBufferUsage_Max = nzBufferUsage_Static
}; };
enum nzCoordSys
{
nzCoordSys_Global,
nzCoordSys_Local,
nzCoordSys_Max = nzCoordSys_Local
};
enum nzCubemapFace enum nzCubemapFace
{ {
// Cette énumération est prévue pour remplacer l'argument "z" des méthodes de NzImage contenant un cubemap // Cette énumération est prévue pour remplacer l'argument "z" des méthodes de NzImage contenant un cubemap

View File

@ -42,8 +42,8 @@ class NAZARA_API NzSkeletalMesh final : public NzSubMesh
const NzBoxf& GetAABB() const; const NzBoxf& GetAABB() const;
nzAnimationType GetAnimationType() const final; nzAnimationType GetAnimationType() const final;
void* GetBindPoseBuffer(); NzMeshVertex* GetBindPoseBuffer();
const void* GetBindPoseBuffer() const; const NzMeshVertex* GetBindPoseBuffer() const;
const NzIndexBuffer* GetIndexBuffer() const override; const NzIndexBuffer* GetIndexBuffer() const override;
unsigned int GetVertexCount() const override; unsigned int GetVertexCount() const override;
NzVertexWeight* GetVertexWeight(unsigned int vertexIndex = 0); NzVertexWeight* GetVertexWeight(unsigned int vertexIndex = 0);

View File

@ -133,7 +133,7 @@ namespace
struct NzSkeletalMeshImpl struct NzSkeletalMeshImpl
{ {
std::unique_ptr<nzUInt8[]> bindPoseBuffer; std::unique_ptr<NzMeshVertex[]> bindPoseBuffer;
std::vector<NzVertexWeight> vertexWeights; std::vector<NzVertexWeight> vertexWeights;
std::vector<NzWeight> weights; std::vector<NzWeight> weights;
NzBoxf aabb; NzBoxf aabb;
@ -170,7 +170,7 @@ bool NzSkeletalMesh::Create(unsigned int vertexCount, unsigned int weightCount)
#endif #endif
m_impl = new NzSkeletalMeshImpl; m_impl = new NzSkeletalMeshImpl;
m_impl->bindPoseBuffer.reset(new nzUInt8[vertexCount*sizeof(NzMeshVertex)]); m_impl->bindPoseBuffer.reset(new NzMeshVertex[vertexCount]);
m_impl->vertexCount = vertexCount; m_impl->vertexCount = vertexCount;
m_impl->vertexWeights.resize(vertexCount); m_impl->vertexWeights.resize(vertexCount);
m_impl->weights.resize(weightCount); m_impl->weights.resize(weightCount);
@ -207,7 +207,7 @@ nzAnimationType NzSkeletalMesh::GetAnimationType() const
return nzAnimationType_Skeletal; return nzAnimationType_Skeletal;
} }
void* NzSkeletalMesh::GetBindPoseBuffer() NzMeshVertex* NzSkeletalMesh::GetBindPoseBuffer()
{ {
#if NAZARA_UTILITY_SAFE #if NAZARA_UTILITY_SAFE
if (!m_impl) if (!m_impl)
@ -220,7 +220,7 @@ void* NzSkeletalMesh::GetBindPoseBuffer()
return m_impl->bindPoseBuffer.get(); return m_impl->bindPoseBuffer.get();
} }
const void* NzSkeletalMesh::GetBindPoseBuffer() const const NzMeshVertex* NzSkeletalMesh::GetBindPoseBuffer() const
{ {
#if NAZARA_UTILITY_SAFE #if NAZARA_UTILITY_SAFE
if (!m_impl) if (!m_impl)
@ -358,7 +358,7 @@ void NzSkeletalMesh::Skin(NzMeshVertex* outputBuffer, const NzSkeleton* skeleton
#endif #endif
SkinningInfos skinningInfos; SkinningInfos skinningInfos;
skinningInfos.inputVertex = reinterpret_cast<const NzMeshVertex*>(m_impl->bindPoseBuffer.get()); skinningInfos.inputVertex = m_impl->bindPoseBuffer.get();
skinningInfos.outputVertex = outputBuffer; skinningInfos.outputVertex = outputBuffer;
skinningInfos.joints = skeleton->GetJoints(); skinningInfos.joints = skeleton->GetJoints();
skinningInfos.vertexWeights = &m_impl->vertexWeights[0]; skinningInfos.vertexWeights = &m_impl->vertexWeights[0];
@ -380,7 +380,7 @@ void NzSkeletalMesh::Skin(NzMeshVertex* outputBuffer, const NzSkeleton* skeleton
Skin_PositionNormalTangent(skinningInfos, 0, m_impl->vertexCount); Skin_PositionNormalTangent(skinningInfos, 0, m_impl->vertexCount);
#endif #endif
m_impl->aabb = skeleton->GetAABB(); m_impl->aabb = skeleton->GetAABB(); ///FIXME: Qu'est-ce que ça fait encore là ça ?
} }
void NzSkeletalMesh::SetIndexBuffer(const NzIndexBuffer* indexBuffer) void NzSkeletalMesh::SetIndexBuffer(const NzIndexBuffer* indexBuffer)