d3d10/include/gltf.hpp
Zack Buhman 7985ad3434 remove dependency on d3dx
This is mostly because it is not possible to statically link d3dx10.

Coincidentally, the directxmath API appears to be superior to d3dxmath in most
ways.
2026-01-13 12:50:02 -06:00

63 lines
1.3 KiB
C++

#ifndef GLTF_HPP_
#define GLTF_HPP_
struct Mesh {
const XMFLOAT3 * position;
const int position_size;
const XMFLOAT3 * normal;
const int normal_size;
const XMFLOAT2 * texcoord_0;
const int texcoord_0_size;
const XMFLOAT4 * weights_0;
const int weights_0_size;
const XMFLOAT4 * joints_0;
const int joints_0_size;
const int * indices;
const int indices_size;
};
struct Skin;
struct Node {
const int parent_ix;
const Skin * skin; // skin index (global)
const Mesh * mesh; // mesh index (global)
const XMFLOAT3 translation;
const XMFLOAT4 rotation;
const XMFLOAT3 scale;
};
struct Skin {
const XMMATRIX * inverse_bind_matrices; // accessor
const int * joints;
int joints_length;
};
enum AnimationChannelPath {
ACP__WEIGHTS,
ACP__ROTATION,
ACP__TRANSLATION,
ACP__SCALE,
};
struct AnimationSampler {
const float * input; // accessor index, containing keyframe timestamps
const void * output; // accessor index, containing keyframe values (type depends on channel target path)
const int length;
};
struct AnimationChannel {
const AnimationSampler * sampler; // sampler index, this animation
struct {
const int node_ix;
const AnimationChannelPath path; // property to animate
} target;
};
#endif