| 397 | } |
| 398 | |
| 399 | void Skeleton::UpdateJointMap() const |
| 400 | { |
| 401 | #ifdef NAZARA_DEBUG |
| 402 | if (!m_impl) |
| 403 | { |
| 404 | NazaraError("Invalid skeleton"); |
| 405 | return; |
| 406 | } |
| 407 | #endif |
| 408 | |
| 409 | m_impl->jointMap.clear(); |
| 410 | for (std::size_t i = 0; i < m_impl->joints.size(); ++i) |
| 411 | { |
| 412 | String name = m_impl->joints[i].GetName(); |
| 413 | if (!name.IsEmpty()) |
| 414 | { |
| 415 | NazaraAssert(m_impl->jointMap.find(name) == m_impl->jointMap.end(), "Joint name \"" + name + "\" is already present in joint map"); |
| 416 | |
| 417 | m_impl->jointMap[name] = static_cast<UInt32>(i); |
| 418 | } |
| 419 | } |
| 420 | |
| 421 | m_impl->jointMapUpdated = true; |
| 422 | } |
| 423 | |
| 424 | bool Skeleton::Initialize() |
| 425 | { |