Cleaned interface
Former-commit-id: cdd284de8396d5988853c84d5db17bfa6fa0ba51
This commit is contained in:
parent
0612e9bea5
commit
6b2af70f1d
|
|
@ -7,6 +7,14 @@
|
|||
#ifndef NAZARA_ENUMS_CORE_HPP
|
||||
#define NAZARA_ENUMS_CORE_HPP
|
||||
|
||||
enum nzCoordSys
|
||||
{
|
||||
nzCoordSys_Global,
|
||||
nzCoordSys_Local,
|
||||
|
||||
nzCoordSys_Max = nzCoordSys_Local
|
||||
};
|
||||
|
||||
enum nzEndianness
|
||||
{
|
||||
nzEndianness_Unknown = -1,
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class NzBox
|
|||
NzBox(T X, T Y, T Z, T Width, T Height, T Depth);
|
||||
NzBox(const T box[6]);
|
||||
NzBox(const NzRect<T>& rect);
|
||||
NzBox(const NzVector3<T>& size);
|
||||
NzBox(const NzVector3<T>& lengths);
|
||||
NzBox(const NzVector3<T>& vec1, const NzVector3<T>& vec2);
|
||||
template<typename U> explicit NzBox(const NzBox<U>& box);
|
||||
NzBox(const NzBox& box) = default;
|
||||
|
|
@ -60,7 +60,7 @@ class NzBox
|
|||
NzBox& Set(const T box[6]);
|
||||
NzBox& Set(const NzBox& box);
|
||||
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);
|
||||
template<typename U> NzBox& Set(const NzBox<U>& box);
|
||||
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@ NzBox<T>::NzBox(const NzRect<T>& rect)
|
|||
}
|
||||
|
||||
template<typename T>
|
||||
NzBox<T>::NzBox(const NzVector3<T>& size)
|
||||
NzBox<T>::NzBox(const NzVector3<T>& lengths)
|
||||
{
|
||||
Set(size);
|
||||
Set(lengths);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
|
@ -344,9 +344,9 @@ NzBox<T>& NzBox<T>::Set(const NzRect<T>& rect)
|
|||
}
|
||||
|
||||
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>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class NzRect
|
|||
NzRect(T Width, T Height);
|
||||
NzRect(T X, T Y, T Width, T Height);
|
||||
NzRect(const T rect[4]);
|
||||
NzRect(const NzVector2<T>& size);
|
||||
NzRect(const NzVector2<T>& lengths);
|
||||
NzRect(const NzVector2<T>& vec1, const NzVector2<T>& vec2);
|
||||
template<typename U> explicit NzRect(const NzRect<U>& rect);
|
||||
NzRect(const NzRect& rect) = default;
|
||||
|
|
@ -50,7 +50,7 @@ class NzRect
|
|||
NzRect& Set(T X, T Y, T Width, T Height);
|
||||
NzRect& Set(const T rect[4]);
|
||||
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);
|
||||
template<typename U> NzRect& Set(const NzRect<U>& rect);
|
||||
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@ NzRect<T>::NzRect(const T vec[4])
|
|||
}
|
||||
|
||||
template<typename T>
|
||||
NzRect<T>::NzRect(const NzVector2<T>& size)
|
||||
NzRect<T>::NzRect(const NzVector2<T>& lengths)
|
||||
{
|
||||
Set(size);
|
||||
Set(lengths);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
|
@ -245,9 +245,9 @@ NzRect<T>& NzRect<T>::Set(const NzRect<T>& rect)
|
|||
}
|
||||
|
||||
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>
|
||||
|
|
|
|||
|
|
@ -50,14 +50,6 @@ enum nzBufferUsage
|
|||
nzBufferUsage_Max = nzBufferUsage_Static
|
||||
};
|
||||
|
||||
enum nzCoordSys
|
||||
{
|
||||
nzCoordSys_Global,
|
||||
nzCoordSys_Local,
|
||||
|
||||
nzCoordSys_Max = nzCoordSys_Local
|
||||
};
|
||||
|
||||
enum nzCubemapFace
|
||||
{
|
||||
// Cette énumération est prévue pour remplacer l'argument "z" des méthodes de NzImage contenant un cubemap
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ class NAZARA_API NzSkeletalMesh final : public NzSubMesh
|
|||
|
||||
const NzBoxf& GetAABB() const;
|
||||
nzAnimationType GetAnimationType() const final;
|
||||
void* GetBindPoseBuffer();
|
||||
const void* GetBindPoseBuffer() const;
|
||||
NzMeshVertex* GetBindPoseBuffer();
|
||||
const NzMeshVertex* GetBindPoseBuffer() const;
|
||||
const NzIndexBuffer* GetIndexBuffer() const override;
|
||||
unsigned int GetVertexCount() const override;
|
||||
NzVertexWeight* GetVertexWeight(unsigned int vertexIndex = 0);
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ namespace
|
|||
|
||||
struct NzSkeletalMeshImpl
|
||||
{
|
||||
std::unique_ptr<nzUInt8[]> bindPoseBuffer;
|
||||
std::unique_ptr<NzMeshVertex[]> bindPoseBuffer;
|
||||
std::vector<NzVertexWeight> vertexWeights;
|
||||
std::vector<NzWeight> weights;
|
||||
NzBoxf aabb;
|
||||
|
|
@ -170,7 +170,7 @@ bool NzSkeletalMesh::Create(unsigned int vertexCount, unsigned int weightCount)
|
|||
#endif
|
||||
|
||||
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->vertexWeights.resize(vertexCount);
|
||||
m_impl->weights.resize(weightCount);
|
||||
|
|
@ -207,7 +207,7 @@ nzAnimationType NzSkeletalMesh::GetAnimationType() const
|
|||
return nzAnimationType_Skeletal;
|
||||
}
|
||||
|
||||
void* NzSkeletalMesh::GetBindPoseBuffer()
|
||||
NzMeshVertex* NzSkeletalMesh::GetBindPoseBuffer()
|
||||
{
|
||||
#if NAZARA_UTILITY_SAFE
|
||||
if (!m_impl)
|
||||
|
|
@ -220,7 +220,7 @@ void* NzSkeletalMesh::GetBindPoseBuffer()
|
|||
return m_impl->bindPoseBuffer.get();
|
||||
}
|
||||
|
||||
const void* NzSkeletalMesh::GetBindPoseBuffer() const
|
||||
const NzMeshVertex* NzSkeletalMesh::GetBindPoseBuffer() const
|
||||
{
|
||||
#if NAZARA_UTILITY_SAFE
|
||||
if (!m_impl)
|
||||
|
|
@ -358,7 +358,7 @@ void NzSkeletalMesh::Skin(NzMeshVertex* outputBuffer, const NzSkeleton* skeleton
|
|||
#endif
|
||||
|
||||
SkinningInfos skinningInfos;
|
||||
skinningInfos.inputVertex = reinterpret_cast<const NzMeshVertex*>(m_impl->bindPoseBuffer.get());
|
||||
skinningInfos.inputVertex = m_impl->bindPoseBuffer.get();
|
||||
skinningInfos.outputVertex = outputBuffer;
|
||||
skinningInfos.joints = skeleton->GetJoints();
|
||||
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);
|
||||
#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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue