3#include <glm/mat4x4.hpp>
4#include <glm/ext/quaternion_float.hpp>
53 const uint32_t HeaderMagic = 0xC065C065;
54 const uint32_t Version = 3;
55 const size_t CogsSectionAlignment = 16;
62 uint32_t sectionCount;
65 static_assert(
sizeof(
Header) == 4 * 8);
67 enum struct Compression : uint32_t
73 enum struct SectionType : uint16_t
78 ENABLE_ENUM_FLAGS(SectionType);
84 uint64_t uncompressedSize;
85 Compression compression;
87 uint16_t subSectionCount;
91 enum struct SubSectionType: uint32_t
123 enum struct Format : uint16_t {
215 ENABLE_ENUM_FLAGS(MeshFlags);
225 TriangleListAdjacency = 5,
226 TriangleStripAdjacency = 6,
227 LineListAdjacency = 7,
228 LineStripAdjacency = 8,
229 ControlPoint1PatchList = 9,
230 ControlPoint2PatchList = 10,
231 ControlPoint3PatchList = 11,
232 ControlPoint4PatchList = 12,
236 enum struct Semantic : uint8_t
248 enum struct InputType : uint8_t
268 enum struct BufferContentFlags : uint32_t
277 ENABLE_ENUM_FLAGS(BufferContentFlags);
286 static_assert(
sizeof(
Buffer) == 2 * 8);
293 uint8_t semanticIndex;
294 uint16_t instanceStepRate;
303 uint32_t firstAttribute;
304 uint32_t attributeCount;
306 uint8_t vertexDataType;
318 PrimitiveType primitiveType;
320 static_assert(
sizeof(
Mesh) == 4 * 4);
329 uint32_t depthStride;
331 static_assert(
sizeof(
Level) == 4 * 4);
334 enum struct TextureEncoding : uint8_t
358 TextureEncoding encoding;
361 static_assert(
sizeof(
Texture) == 10 * 4);
364 enum struct PropertyKeyType : uint16_t
371 enum struct PropertyValueType : uint16_t
387 PropertyKeyType keyType;
388 PropertyValueType valueType;
392 static_assert(
alignof(
Property) == 4);
407 for (
float value : m) {
413 static_assert(
sizeof(
Transform) == 6 * 8);
416 enum struct BoneFlags : uint16_t
423 ENABLE_ENUM_FLAGS(BoneFlags);
427 glm::mat4 inverseBindPose;
436 static_assert(
sizeof(
Bone) == 44 * 4);
449 uint32_t translationOffset;
450 uint32_t translationCount;
451 uint32_t rotationOffset;
452 uint32_t rotationCount;
453 uint32_t scaleOffset;
456 static_assert(
sizeof(
AnimTrack) == 8 * 4);
483 uint32_t animClipFirst;
484 uint32_t animClipCount;
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
constexpr size_t hash() noexcept
Simple getter function that returns the initial value for fnv1a hashing.
uint32_t name
Offset into strings subsection of current section.
uint32_t boneIndex
Which bone to animate.
uint32_t buffer
Offset into bones array.
uint16_t parentBone
Offset of within range of bones of this skeleton.
uint32_t name
Offset into strings subsection of current section.
uint32_t size
Size of buffer, in bytes.
BufferContentFlags flags
Specifies what kind of data present in the buffer.
uint64_t sectionOffset
Raw section pointer: Upper 16 bits is section id, lower 48 is offset inside that section.
uint32_t bufferView
Index of buffer view with data.
uint32_t propertyFirst
Offset into Properties subsection of current section.
uint32_t permutation
String with permuation name. Offset into strings subsection of current section.
uint32_t propertyCount
Number of properties set in material instance.
uint32_t material
Name of material. Offset into strings subsection of current section.
uint32_t boundingBox
Index of bounding box.
uint32_t firstStream
Index of first stream of mesh.
uint32_t name
Index of string with name.
uint32_t skeleton
Offset into the Skeleton subsection of current section.
uint32_t nodeCount
Number of nodes in model.
uint32_t firstNode
Offset of first node into Nodes subsection of current section.
uint32_t mesh
Mesh of node, offset into Meshes subsection.
uint32_t name
Name of node, offset into Strings subsection.
uint32_t transform
Transform of node, offset into Transforms subsection.
PrimitiveType primitiveType
Primitive type to use for this node.
uint32_t materialInstance
Material instance of node, offset into MaterialInstances subsection.
uint32_t vertexCount
Number of vertices to draw.
uint32_t parent
Parent node, offset into Nodes subsection.
uint32_t boundingBox
Bounding box of node, offset into BoundingBoxes subsection.
uint32_t vertexFirst
First vertex of mesh to draw.
uint32_t boneCount
Number of bones in skeleton.
uint32_t firstBone
Offset into Bones subsection of current section.
uint32_t buffer
Buffer that holds image data, index into buffers.
uint32_t offset
Byte offset within buffer for start of imagte data.
uint32_t size
Byte size of image data.
Defines mesh flags controlling the behavior of Mesh resources.
Primitive types for interpreting vertex data sent to the graphics pipeline.
Texture flags describing valid usage for a texture object.