glTF – loading a skeleton
We need to implement one more loading function—the LoadSkeleton
function. This is a convenience function that loads a skeleton without having to call three separate functions.
Implement the LoadSkeleton
function in GLTFLoader.cpp
. Don't forget to add the function declaration to GLTFLoader.h
. The function returns a new skeleton by calling the existing LoadPose
, LoadBindPose
, and LoadJointNames
functions:
Skeleton LoadSkeleton(cgltf_data* data) { return Skeleton( LoadRestPose(data), LoadBindPose(data), LoadJointNames(data) ); }
The LoadSkeleton
function is just a helper function that allows you to initialize a skeleton with a single function call. In the next section, you will implement a Mesh
class, which will let you display animated meshes...