Model Hierarchies¶
Loading Model Hierarchies¶
Example
#include <zenkit-capi/ModelHierarchy.h>
#include <zenkit-capi/Vfs.h>
int main(int, const char** argv) {
// Load from a file on disk:
ZkModelHierarchy* mdh = ZkModelHierarchy_loadPath("MySkeleton.MDH");
ZkModelHierarchy_del(mdh);
// ... or from a VFS:
ZkVfs* vfs = ZkVfs_new();
ZkVfs_mountDiskHost(vfs, "Anims.vdf", ZkVfsOverwriteBehavior_OLDER);
mdh = ZkModelHierarchy_loadVfs(vfs, "MySkeleton.MDH");
ZkModelHierarchy_del(mdh);
ZkVfs_del(vfs);
return 0;
}
Example
#include <zenkit/ModelHierarchy.hh>
#include <zenkit/Stream.hh>
#include <zenkit/Vfs.hh>
int main(int, char const** argv) {
zenkit::ModelHierarchy mdh {};
// Load from a file on disk:
auto r = zenkit::Read::from("MySkeleton.MDH");
mdh.load(r.get());
// ... or from a VFS
zenkit::Vfs vfs;
vfs.mount_disk("Anims.vdf", zenkit::VfsOverwriteBehavior::OLDER)
r = vfs->find("MySkeleton.MDH")->open_read();
mdh.load(r.get());
return 0;
}
Example
import dev.gothickit.zenkit.mdh.ModelHierarchy;
import dev.gothickit.zenkit.vfs.Vfs;
import dev.gothickit.zenkit.vfs.VfsOverwriteBehavior;
// Load from a file on disk:
var mdh = ModelHierarchy.load("MySkeleton.MDH");
// ... or from a VFS:
var vfs = new Vfs();
vfs.mountDisk("Anims.vdf", VfsOverwriteBehavior.OLDER)
mdh = ModelHierarchy.load(vfs, "MySkeleton.MDH");