62 lines
1.4 KiB
C++
62 lines
1.4 KiB
C++
struct Mesh {
|
|
const D3DXVECTOR3 * position;
|
|
const DWORD position_size;
|
|
|
|
const D3DXVECTOR3 * normal;
|
|
const DWORD normal_size;
|
|
|
|
const D3DXVECTOR2 * texcoord_0;
|
|
const DWORD texcoord_0_size;
|
|
|
|
const D3DXVECTOR4 * weights_0;
|
|
const DWORD weights_0_size;
|
|
|
|
const D3DXVECTOR4 * joints_0;
|
|
const DWORD joints_0_size;
|
|
|
|
const DWORD * indices;
|
|
const DWORD indices_size;
|
|
};
|
|
|
|
struct Skin;
|
|
|
|
struct Node {
|
|
const Skin * skin; // skin index (global)
|
|
const Mesh * mesh; // mesh index (global)
|
|
const D3DXVECTOR3 translation;
|
|
const D3DXQUATERNION rotation;
|
|
const D3DXVECTOR3 scale;
|
|
};
|
|
|
|
struct Skin {
|
|
const D3DXMATRIX * inverse_bind_matrices; // accessor
|
|
const Node ** joints;
|
|
DWORD 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 Node * node; // node index
|
|
const AnimationChannelPath path; // property to animate
|
|
} target;
|
|
};
|
|
|
|
//struct Animation {
|
|
// const AnimationChannel * channels;
|
|
// const AnimationSampler * samplers;
|
|
//};
|