mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-02 22:32:19 -05:00
d24c8453db
subrepo: subdir: "libultraship" merged: "a484cda98" upstream: origin: "https://github.com/HarbourMasters/libultraship.git" branch: "main" commit: "a484cda98" git-subrepo: version: "0.4.1" origin: "???" commit: "???"
69 lines
1.2 KiB
C++
69 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include <vector>
|
|
#include <string>
|
|
#include "Resource.h"
|
|
#include "Vec2f.h"
|
|
#include "Vec3f.h"
|
|
#include "Color3b.h"
|
|
|
|
namespace Ship
|
|
{
|
|
enum class ModelType
|
|
{
|
|
Normal = 0,
|
|
Flex = 1,
|
|
Skinned = 2,
|
|
};
|
|
|
|
class VertexData
|
|
{
|
|
DataType dataType;
|
|
uint8_t dimensionCnt;
|
|
uint32_t entryCnt;
|
|
uint32_t offsetToData;
|
|
};
|
|
|
|
class ModelV0 : public ResourceFile
|
|
{
|
|
public:
|
|
// HEADER
|
|
ModelType modelType;
|
|
|
|
uint32_t numVerts;
|
|
uint32_t numPolys;
|
|
|
|
uint32_t vertices;
|
|
uint32_t normals;
|
|
uint32_t faces;
|
|
uint32_t vertexColors;
|
|
uint32_t uvCoords;
|
|
uint32_t boneWeights;
|
|
|
|
void ParseFileBinary(BinaryReader* reader, Resource* res) override;
|
|
};
|
|
|
|
struct Vertex
|
|
{
|
|
Vec3f pos;
|
|
Vec3f normal;
|
|
Color3b color;
|
|
Vec2f uv;
|
|
|
|
Vertex();
|
|
Vertex(BinaryReader* reader);
|
|
};
|
|
|
|
class Model : public Resource
|
|
{
|
|
public:
|
|
ModelType modelType;
|
|
|
|
uint32_t numVerts;
|
|
uint32_t numPolys;
|
|
|
|
Vertex* vertices;
|
|
Vec2f* boneWeights;
|
|
uint32_t* indices;
|
|
};
|
|
} |