MCPcopy Create free account
hub / github.com/assimp/assimp / ReadBone

Method ReadBone

code/AssetLib/Ogre/OgreBinarySerializer.cpp:858–879  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

856}
857
858void OgreBinarySerializer::ReadBone(Skeleton *skeleton) {
859 Bone *bone = new Bone();
860 bone->name = ReadLine();
861 bone->id = Read<uint16_t>();
862
863 // Pos and rot
864 ReadVector(bone->position);
865 ReadQuaternion(bone->rotation);
866
867 // Scale (optional)
868 if (m_currentLen > MSTREAM_BONE_SIZE_WITHOUT_SCALE)
869 ReadVector(bone->scale);
870
871 // Bone indexes need to start from 0 and be contiguous
872 if (bone->id != skeleton->bones.size()) {
873 throw DeadlyImportError("Ogre Skeleton bone indexes not contiguous. Error at bone index ", bone->id);
874 }
875
876 ASSIMP_LOG_VERBOSE_DEBUG(" ", bone->id, " ", bone->name);
877
878 skeleton->bones.push_back(bone);
879}
880
881void OgreBinarySerializer::ReadBoneParent(Skeleton *skeleton) {
882 uint16_t childId = Read<uint16_t>();

Callers

nothing calls this directly

Calls 4

ReadVectorFunction · 0.85
DeadlyImportErrorFunction · 0.85
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected