Administrative source import: native x86 compilation passed for 423 authored units. Source placement and submission states are migrated separately; this commit does not imply peer acceptance.
Previous head: 35d2a8cb36
Payload SHA256: 592f016d2730c5593bb653aa054c1e5f76a6df72c8f5a09e66f74876e2e33dee
42 lines
975 B
C++
42 lines
975 B
C++
#ifndef RAGNAROK_SOURCE_RESOURCE_MODELS_MODELMESH_H
|
|
#define RAGNAROK_SOURCE_RESOURCE_MODELS_MODELMESH_H
|
|
|
|
#include <array>
|
|
#include <cstdint>
|
|
#include <vector>
|
|
|
|
struct ModelFace {
|
|
ModelFace();
|
|
|
|
std::uint16_t vertices[3];
|
|
std::uint16_t textureVertices[3];
|
|
std::uint16_t texture;
|
|
std::uint16_t unknown_000E;
|
|
std::uint32_t twoSided;
|
|
std::vector<std::uint32_t> smoothing;
|
|
};
|
|
|
|
struct ModelTextureVertex {
|
|
/* 0000 */ std::uint32_t shaded;
|
|
/* 0004 */ float u;
|
|
/* 0008 */ float v;
|
|
};
|
|
|
|
static_assert(sizeof(ModelTextureVertex) == 12);
|
|
|
|
struct ModelMesh {
|
|
std::vector<std::array<float, 3>> vertices;
|
|
std::vector<ModelTextureVertex> textureVertices;
|
|
std::vector<ModelFace> faces;
|
|
std::vector<std::array<float, 3>> faceNormals;
|
|
std::vector<std::array<float, 3>> vertexNormals;
|
|
std::array<std::vector<std::uint32_t>, 32> indices;
|
|
|
|
void CalculateNormals();
|
|
};
|
|
|
|
#if defined(_WIN32) && !defined(_WIN64)
|
|
static_assert(sizeof(ModelFace) == 32);
|
|
#endif
|
|
|
|
#endif
|