Shipwright/libultraship/libultraship/Model.h
M4xw d24c8453db git subrepo clone https://github.com/HarbourMasters/libultraship.git
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:   "???"
2022-03-22 02:52:44 +01:00

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;
};
}