NcEngine
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages Concepts
Assets.h
Go to the documentation of this file.
1
5#pragma once
6
7#include "AssetType.h"
8
9#include "ncmath/Geometry.h"
10#include "DirectXMath.h"
11
12#include <array>
13#include <optional>
14#include <string>
15#include <unordered_map>
16#include <vector>
17
18namespace nc::asset
19{
21{
22 size_t samplesPerChannel;
23 std::vector<double> leftChannel;
24 std::vector<double> rightChannel;
25};
26
28{
29 std::string boneName;
30 DirectX::XMMATRIX transformationMatrix;
31};
32
34{
35 std::string boneName;
36 DirectX::XMMATRIX transformationMatrix;
37 uint32_t numChildren;
38 uint32_t indexOfFirstChild;
39};
40
42{
43 std::unordered_map<std::string, uint32_t> boneMapping;
44 std::vector<VertexSpaceToBoneSpace> vertexSpaceToBoneSpace;
45 std::vector<BoneSpaceToParentSpace> boneSpaceToParentSpace;
46};
47
49{
50 Vector3 extents;
51 float maxExtent;
52 std::vector<uint8_t> blob;
53};
54
56{
57 Vector3 extents;
58 float maxExtent;
59 std::vector<uint8_t> blob;
60};
61
63{
64 Vector3 position = Vector3::Zero();
65 Vector3 normal = Vector3::Zero();
66 Vector2 uv = Vector2::Zero();
67 Vector4 boneWeights = Vector4::Zero();
68 std::array<uint32_t, 4> boneIds = {0, 0, 0, 0};
69};
70
71struct Mesh
72{
73 Vector3 extents;
74 float maxExtent;
75 std::vector<MeshVertex> vertices;
76 std::vector<uint32_t> indices;
77 std::optional<BonesData> bonesData;
78};
79
81{
82 std::array<float, 4> boneWeights {-1, -1, -1, -1};
83 std::array<uint32_t, 4> boneIds;
84};
85
86struct Shader
87{
88};
89
91{
92 float timeInTicks;
93 Vector3 position;
94};
95
97{
98 float timeInTicks;
99 Quaternion rotation;
100};
101
103{
104 float timeInTicks;
105 Vector3 scale;
106};
107
109{
110 // Vectors are not guaranteed to be the same length.
111 // There could be no rotation data for a frame, for example.
112 std::vector<PositionFrame> positionFrames;
113 std::vector<RotationFrame> rotationFrames;
114 std::vector<ScaleFrame> scaleFrames;
115};
116
118{
119 std::string name;
120 uint32_t durationInTicks;
121 float ticksPerSecond;
122 std::unordered_map<std::string, SkeletalAnimationFrames> framesPerBone;
123};
124
126{
127 uint32_t width = 0u;
128 uint32_t height = 0u;
129 std::vector<unsigned char> pixelData = {};
130};
131
133{
134 static constexpr uint32_t numChannels = 4u;
135
136 TextureFormat format = TextureFormat::UNKNOWN;
137 uint32_t width = 0u;
138 uint32_t height = 0u;
139 std::vector<unsigned char> pixelData = {};
140 std::vector<TextureSubResource> mipmaps = {};
141};
142
144{
145 static constexpr uint32_t numChannels = 4u;
146
147 TextureFormat format = TextureFormat::UNKNOWN;
148 uint32_t faceSideLength = 0u;
149 std::array<std::vector<unsigned char>, 6> faces = {};
150};
151} // namespace nc::asset
TextureFormat
Texture formats.
Definition: AssetType.h:37
Quaternion type for representing 3D rotations.
Definition: Quaternion.h:13
A two component vector.
Definition: Vector.h:13
A three component vector.
Definition: Vector.h:29
A four component vector.
Definition: Vector.h:48
Definition: Assets.h:21
Definition: Assets.h:34
Definition: Assets.h:42
Definition: Assets.h:49
Definition: Assets.h:144
Definition: Assets.h:56
Definition: Assets.h:72
Definition: Assets.h:63
Definition: Assets.h:81
Definition: Assets.h:91
Definition: Assets.h:97
Definition: Assets.h:103
Definition: Assets.h:87
Definition: Assets.h:109
Definition: Assets.h:118
Definition: Assets.h:133
Definition: Assets.h:126
Definition: Assets.h:28