Switch from Nz prefix to namespace Nz
What a huge commit Former-commit-id: 38ac5eebf70adc1180f571f6006192d28fb99897
This commit is contained in:
@@ -15,65 +15,68 @@
|
||||
#include <Nazara/Utility/Animation.hpp>
|
||||
#include <vector>
|
||||
|
||||
class NAZARA_UTILITY_API NzMD5AnimParser
|
||||
namespace Nz
|
||||
{
|
||||
public:
|
||||
struct FrameJoint
|
||||
{
|
||||
NzQuaternionf orient;
|
||||
NzVector3f pos;
|
||||
};
|
||||
class NAZARA_UTILITY_API MD5AnimParser
|
||||
{
|
||||
public:
|
||||
struct FrameJoint
|
||||
{
|
||||
Quaternionf orient;
|
||||
Vector3f pos;
|
||||
};
|
||||
|
||||
struct Frame
|
||||
{
|
||||
std::vector<FrameJoint> joints;
|
||||
NzBoxf bounds;
|
||||
};
|
||||
struct Frame
|
||||
{
|
||||
std::vector<FrameJoint> joints;
|
||||
Boxf bounds;
|
||||
};
|
||||
|
||||
struct Joint
|
||||
{
|
||||
NzQuaternionf bindOrient;
|
||||
NzString name;
|
||||
NzVector3f bindPos;
|
||||
int parent;
|
||||
unsigned int flags;
|
||||
unsigned int index;
|
||||
};
|
||||
struct Joint
|
||||
{
|
||||
Quaternionf bindOrient;
|
||||
String name;
|
||||
Vector3f bindPos;
|
||||
int parent;
|
||||
unsigned int flags;
|
||||
unsigned int index;
|
||||
};
|
||||
|
||||
NzMD5AnimParser(NzInputStream& stream);
|
||||
~NzMD5AnimParser();
|
||||
MD5AnimParser(InputStream& stream);
|
||||
~MD5AnimParser();
|
||||
|
||||
nzTernary Check();
|
||||
Ternary Check();
|
||||
|
||||
unsigned int GetAnimatedComponentCount() const;
|
||||
const Frame* GetFrames() const;
|
||||
unsigned int GetFrameCount() const;
|
||||
unsigned int GetFrameRate() const;
|
||||
const Joint* GetJoints() const;
|
||||
unsigned int GetJointCount() const;
|
||||
unsigned int GetAnimatedComponentCount() const;
|
||||
const Frame* GetFrames() const;
|
||||
unsigned int GetFrameCount() const;
|
||||
unsigned int GetFrameRate() const;
|
||||
const Joint* GetJoints() const;
|
||||
unsigned int GetJointCount() const;
|
||||
|
||||
bool Parse();
|
||||
bool Parse();
|
||||
|
||||
private:
|
||||
bool Advance(bool required = true);
|
||||
void Error(const NzString& message);
|
||||
bool ParseBaseframe();
|
||||
bool ParseBounds();
|
||||
bool ParseFrame();
|
||||
bool ParseHierarchy();
|
||||
void Warning(const NzString& message);
|
||||
void UnrecognizedLine(bool error = false);
|
||||
private:
|
||||
bool Advance(bool required = true);
|
||||
void Error(const String& message);
|
||||
bool ParseBaseframe();
|
||||
bool ParseBounds();
|
||||
bool ParseFrame();
|
||||
bool ParseHierarchy();
|
||||
void Warning(const String& message);
|
||||
void UnrecognizedLine(bool error = false);
|
||||
|
||||
std::vector<float> m_animatedComponents;
|
||||
std::vector<Frame> m_frames;
|
||||
std::vector<Joint> m_joints;
|
||||
NzInputStream& m_stream;
|
||||
NzString m_currentLine;
|
||||
bool m_keepLastLine;
|
||||
unsigned int m_frameIndex;
|
||||
unsigned int m_frameRate;
|
||||
unsigned int m_lineCount;
|
||||
unsigned int m_streamFlags;
|
||||
};
|
||||
std::vector<float> m_animatedComponents;
|
||||
std::vector<Frame> m_frames;
|
||||
std::vector<Joint> m_joints;
|
||||
InputStream& m_stream;
|
||||
String m_currentLine;
|
||||
bool m_keepLastLine;
|
||||
unsigned int m_frameIndex;
|
||||
unsigned int m_frameRate;
|
||||
unsigned int m_lineCount;
|
||||
unsigned int m_streamFlags;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // NAZARA_FORMATS_MD5ANIMPARSER_HPP
|
||||
|
||||
@@ -15,69 +15,72 @@
|
||||
#include <Nazara/Utility/Mesh.hpp>
|
||||
#include <vector>
|
||||
|
||||
class NAZARA_UTILITY_API NzMD5MeshParser
|
||||
namespace Nz
|
||||
{
|
||||
public:
|
||||
struct Joint
|
||||
{
|
||||
NzQuaternionf bindOrient;
|
||||
NzString name;
|
||||
NzVector3f bindPos;
|
||||
int parent;
|
||||
};
|
||||
class NAZARA_UTILITY_API MD5MeshParser
|
||||
{
|
||||
public:
|
||||
struct Joint
|
||||
{
|
||||
Quaternionf bindOrient;
|
||||
String name;
|
||||
Vector3f bindPos;
|
||||
int parent;
|
||||
};
|
||||
|
||||
typedef NzVector3ui Triangle;
|
||||
typedef Vector3ui Triangle;
|
||||
|
||||
struct Vertex
|
||||
{
|
||||
NzVector2f uv;
|
||||
unsigned int startWeight;
|
||||
unsigned int weightCount;
|
||||
};
|
||||
struct Vertex
|
||||
{
|
||||
Vector2f uv;
|
||||
unsigned int startWeight;
|
||||
unsigned int weightCount;
|
||||
};
|
||||
|
||||
struct Weight
|
||||
{
|
||||
NzVector3f pos;
|
||||
float bias;
|
||||
unsigned int joint;
|
||||
};
|
||||
struct Weight
|
||||
{
|
||||
Vector3f pos;
|
||||
float bias;
|
||||
unsigned int joint;
|
||||
};
|
||||
|
||||
struct Mesh
|
||||
{
|
||||
std::vector<Triangle> triangles;
|
||||
std::vector<Vertex> vertices;
|
||||
std::vector<Weight> weights;
|
||||
NzString shader;
|
||||
};
|
||||
struct Mesh
|
||||
{
|
||||
std::vector<Triangle> triangles;
|
||||
std::vector<Vertex> vertices;
|
||||
std::vector<Weight> weights;
|
||||
String shader;
|
||||
};
|
||||
|
||||
NzMD5MeshParser(NzInputStream& stream);
|
||||
~NzMD5MeshParser();
|
||||
MD5MeshParser(InputStream& stream);
|
||||
~MD5MeshParser();
|
||||
|
||||
nzTernary Check();
|
||||
Ternary Check();
|
||||
|
||||
const Joint* GetJoints() const;
|
||||
unsigned int GetJointCount() const;
|
||||
const Mesh* GetMeshes() const;
|
||||
unsigned int GetMeshCount() const;
|
||||
const Joint* GetJoints() const;
|
||||
unsigned int GetJointCount() const;
|
||||
const Mesh* GetMeshes() const;
|
||||
unsigned int GetMeshCount() const;
|
||||
|
||||
bool Parse();
|
||||
bool Parse();
|
||||
|
||||
private:
|
||||
bool Advance(bool required = true);
|
||||
void Error(const NzString& message);
|
||||
bool ParseJoints();
|
||||
bool ParseMesh();
|
||||
void Warning(const NzString& message);
|
||||
void UnrecognizedLine(bool error = false);
|
||||
private:
|
||||
bool Advance(bool required = true);
|
||||
void Error(const String& message);
|
||||
bool ParseJoints();
|
||||
bool ParseMesh();
|
||||
void Warning(const String& message);
|
||||
void UnrecognizedLine(bool error = false);
|
||||
|
||||
std::vector<Joint> m_joints;
|
||||
std::vector<Mesh> m_meshes;
|
||||
NzInputStream& m_stream;
|
||||
NzString m_currentLine;
|
||||
bool m_keepLastLine;
|
||||
unsigned int m_lineCount;
|
||||
unsigned int m_meshIndex;
|
||||
unsigned int m_streamFlags;
|
||||
};
|
||||
std::vector<Joint> m_joints;
|
||||
std::vector<Mesh> m_meshes;
|
||||
InputStream& m_stream;
|
||||
String m_currentLine;
|
||||
bool m_keepLastLine;
|
||||
unsigned int m_lineCount;
|
||||
unsigned int m_meshIndex;
|
||||
unsigned int m_streamFlags;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // NAZARA_FORMATS_MD5MESHPARSER_HPP
|
||||
|
||||
@@ -14,49 +14,52 @@
|
||||
#include <Nazara/Utility/Config.hpp>
|
||||
#include <unordered_map>
|
||||
|
||||
class NAZARA_UTILITY_API NzMTLParser
|
||||
namespace Nz
|
||||
{
|
||||
public:
|
||||
struct Material
|
||||
{
|
||||
NzColor ambient = NzColor::White;
|
||||
NzColor diffuse = NzColor::White;
|
||||
NzColor specular = NzColor::White;
|
||||
NzString alphaMap;
|
||||
NzString ambientMap;
|
||||
NzString bumpMap;
|
||||
NzString decalMap;
|
||||
NzString diffuseMap;
|
||||
NzString displacementMap;
|
||||
NzString reflectionMap;
|
||||
NzString shininessMap;
|
||||
NzString specularMap;
|
||||
float alpha = 1.f;
|
||||
float refractionIndex = 1.f;
|
||||
float shininess = 1.f;
|
||||
unsigned int illumModel = 0;
|
||||
};
|
||||
class NAZARA_UTILITY_API MTLParser
|
||||
{
|
||||
public:
|
||||
struct Material
|
||||
{
|
||||
Color ambient = Color::White;
|
||||
Color diffuse = Color::White;
|
||||
Color specular = Color::White;
|
||||
String alphaMap;
|
||||
String ambientMap;
|
||||
String bumpMap;
|
||||
String decalMap;
|
||||
String diffuseMap;
|
||||
String displacementMap;
|
||||
String reflectionMap;
|
||||
String shininessMap;
|
||||
String specularMap;
|
||||
float alpha = 1.f;
|
||||
float refractionIndex = 1.f;
|
||||
float shininess = 1.f;
|
||||
unsigned int illumModel = 0;
|
||||
};
|
||||
|
||||
NzMTLParser(NzInputStream& stream$);
|
||||
~NzMTLParser();
|
||||
MTLParser(InputStream& stream$);
|
||||
~MTLParser();
|
||||
|
||||
const Material* GetMaterial(const NzString& materialName) const;
|
||||
const std::unordered_map<NzString, Material>& GetMaterials() const;
|
||||
const Material* GetMaterial(const String& materialName) const;
|
||||
const std::unordered_map<String, Material>& GetMaterials() const;
|
||||
|
||||
bool Parse();
|
||||
bool Parse();
|
||||
|
||||
private:
|
||||
bool Advance(bool required = true);
|
||||
void Error(const NzString& message);
|
||||
void Warning(const NzString& message);
|
||||
void UnrecognizedLine(bool error = false);
|
||||
private:
|
||||
bool Advance(bool required = true);
|
||||
void Error(const String& message);
|
||||
void Warning(const String& message);
|
||||
void UnrecognizedLine(bool error = false);
|
||||
|
||||
std::unordered_map<NzString, Material> m_materials;
|
||||
NzInputStream& m_stream;
|
||||
NzString m_currentLine;
|
||||
bool m_keepLastLine;
|
||||
unsigned int m_lineCount;
|
||||
unsigned int m_streamFlags;
|
||||
};
|
||||
std::unordered_map<String, Material> m_materials;
|
||||
InputStream& m_stream;
|
||||
String m_currentLine;
|
||||
bool m_keepLastLine;
|
||||
unsigned int m_lineCount;
|
||||
unsigned int m_streamFlags;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // NAZARA_FORMATS_MTLPARSER_HPP
|
||||
|
||||
@@ -15,62 +15,65 @@
|
||||
#include <Nazara/Utility/Config.hpp>
|
||||
#include <vector>
|
||||
|
||||
class NAZARA_UTILITY_API NzOBJParser
|
||||
namespace Nz
|
||||
{
|
||||
public:
|
||||
struct FaceVertex
|
||||
{
|
||||
int normal;
|
||||
int position;
|
||||
int texCoord;
|
||||
};
|
||||
class NAZARA_UTILITY_API OBJParser
|
||||
{
|
||||
public:
|
||||
struct FaceVertex
|
||||
{
|
||||
int normal;
|
||||
int position;
|
||||
int texCoord;
|
||||
};
|
||||
|
||||
struct Face
|
||||
{
|
||||
std::vector<FaceVertex> vertices;
|
||||
};
|
||||
struct Face
|
||||
{
|
||||
std::vector<FaceVertex> vertices;
|
||||
};
|
||||
|
||||
struct Mesh
|
||||
{
|
||||
std::vector<Face> faces;
|
||||
NzString name;
|
||||
unsigned int material;
|
||||
};
|
||||
struct Mesh
|
||||
{
|
||||
std::vector<Face> faces;
|
||||
String name;
|
||||
unsigned int material;
|
||||
};
|
||||
|
||||
NzOBJParser(NzInputStream& stream$);
|
||||
~NzOBJParser();
|
||||
OBJParser(InputStream& stream$);
|
||||
~OBJParser();
|
||||
|
||||
const NzString* GetMaterials() const;
|
||||
unsigned int GetMaterialCount() const;
|
||||
const Mesh* GetMeshes() const;
|
||||
unsigned int GetMeshCount() const;
|
||||
const NzString& GetMtlLib() const;
|
||||
const NzVector3f* GetNormals() const;
|
||||
unsigned int GetNormalCount() const;
|
||||
const NzVector4f* GetPositions() const;
|
||||
unsigned int GetPositionCount() const;
|
||||
const NzVector3f* GetTexCoords() const;
|
||||
unsigned int GetTexCoordCount() const;
|
||||
const String* GetMaterials() const;
|
||||
unsigned int GetMaterialCount() const;
|
||||
const Mesh* GetMeshes() const;
|
||||
unsigned int GetMeshCount() const;
|
||||
const String& GetMtlLib() const;
|
||||
const Vector3f* GetNormals() const;
|
||||
unsigned int GetNormalCount() const;
|
||||
const Vector4f* GetPositions() const;
|
||||
unsigned int GetPositionCount() const;
|
||||
const Vector3f* GetTexCoords() const;
|
||||
unsigned int GetTexCoordCount() const;
|
||||
|
||||
bool Parse();
|
||||
bool Parse();
|
||||
|
||||
private:
|
||||
bool Advance(bool required = true);
|
||||
void Error(const NzString& message);
|
||||
void Warning(const NzString& message);
|
||||
void UnrecognizedLine(bool error = false);
|
||||
private:
|
||||
bool Advance(bool required = true);
|
||||
void Error(const String& message);
|
||||
void Warning(const String& message);
|
||||
void UnrecognizedLine(bool error = false);
|
||||
|
||||
std::vector<Mesh> m_meshes;
|
||||
std::vector<NzString> m_materials;
|
||||
std::vector<NzVector3f> m_normals;
|
||||
std::vector<NzVector4f> m_positions;
|
||||
std::vector<NzVector3f> m_texCoords;
|
||||
NzInputStream& m_stream;
|
||||
NzString m_currentLine;
|
||||
NzString m_mtlLib;
|
||||
bool m_keepLastLine;
|
||||
unsigned int m_lineCount;
|
||||
unsigned int m_streamFlags;
|
||||
};
|
||||
std::vector<Mesh> m_meshes;
|
||||
std::vector<String> m_materials;
|
||||
std::vector<Vector3f> m_normals;
|
||||
std::vector<Vector4f> m_positions;
|
||||
std::vector<Vector3f> m_texCoords;
|
||||
InputStream& m_stream;
|
||||
String m_currentLine;
|
||||
String m_mtlLib;
|
||||
bool m_keepLastLine;
|
||||
unsigned int m_lineCount;
|
||||
unsigned int m_streamFlags;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // NAZARA_FORMATS_OBJPARSER_HPP
|
||||
|
||||
Reference in New Issue
Block a user