| 856 | } |
| 857 | |
| 858 | void 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 | |
| 881 | void OgreBinarySerializer::ReadBoneParent(Skeleton *skeleton) { |
| 882 | uint16_t childId = Read<uint16_t>(); |
nothing calls this directly
no test coverage detected