MCPcopy Create free account
hub / github.com/NazaraEngine/NazaraEngine / SetMesh

Method SetMesh

src/Nazara/Graphics/SkeletalModel.cpp:325–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

GetAnimationTypeMethod · 0.45
GetJointCountMethod · 0.45
GetSkeletonMethod · 0.45

Tested by

no test coverage detected