| 232 | } |
| 233 | |
| 234 | static void FixupModelBones(JNIEnv* env, dmModelImporter::jni::TypeInfos* types, const dmModelImporter::Scene* scene, |
| 235 | const dmArray<jobject>& models, dmHashTable64<jobject>& cache) |
| 236 | { |
| 237 | uint32_t count = scene->m_Models.Size(); |
| 238 | for (uint32_t i = 0; i < count; ++i) |
| 239 | { |
| 240 | const Model* model = &scene->m_Models[i]; |
| 241 | if (!model->m_ParentBone) |
| 242 | continue; |
| 243 | |
| 244 | jobject model_obj = models[model->m_Index]; // TODO: SHould be able to use the object cache here as well. |
| 245 | jobject* bone_obj_p = cache.Get((uintptr_t)model->m_ParentBone); |
| 246 | if (bone_obj_p) |
| 247 | dmJNI::SetObject(env, model_obj, types->m_ModelJNI.parentBone, *bone_obj_p); |
| 248 | else |
| 249 | dmLogError("Failed to find the bone parent pointer"); |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | // ************************************************** |
| 254 | // Meshes |
no test coverage detected