| 323 | */ |
| 324 | |
| 325 | void SkeletalModel::SetMesh(Mesh* mesh) |
| 326 | { |
| 327 | #if NAZARA_GRAPHICS_SAFE |
| 328 | if (mesh && mesh->GetAnimationType() != AnimationType_Skeletal) |
| 329 | { |
| 330 | NazaraError("Mesh animation type must be skeletal"); |
| 331 | return; |
| 332 | } |
| 333 | #endif |
| 334 | |
| 335 | Model::SetMesh(mesh); |
| 336 | |
| 337 | if (m_mesh) |
| 338 | { |
| 339 | if (m_animation && m_animation->GetJointCount() != m_mesh->GetJointCount()) |
| 340 | { |
| 341 | NazaraWarning("Animation joint count is not matching new mesh joint count, disabling animation..."); |
| 342 | SetAnimation(nullptr); |
| 343 | } |
| 344 | |
| 345 | m_skeleton = *m_mesh->GetSkeleton(); // Copy of skeleton template |
| 346 | } |
| 347 | } |
| 348 | |
| 349 | /*! |
| 350 | * \brief Sets the sequence for the model |
nothing calls this directly
no test coverage detected