| 1791 | } |
| 1792 | |
| 1793 | static uint32_t CountAnimatedNodes(Scene* scene, cgltf_data* gltf_data, cgltf_animation* animation, dmHashTable64<uint32_t>& node_to_index) |
| 1794 | { |
| 1795 | node_to_index.SetCapacity((32*2)/3, 32); |
| 1796 | |
| 1797 | for (size_t i = 0; i < animation->channels_count; ++i) |
| 1798 | { |
| 1799 | if (node_to_index.Full()) |
| 1800 | { |
| 1801 | uint32_t new_capacity = node_to_index.Capacity() + 32; |
| 1802 | node_to_index.SetCapacity((new_capacity*2)/3, new_capacity); |
| 1803 | } |
| 1804 | |
| 1805 | Node* target_node = TranslateNode(animation->channels[i].target_node, gltf_data, scene); |
| 1806 | dmhash_t node_name_hash = dmHashString64(target_node->m_Name); |
| 1807 | |
| 1808 | uint32_t* prev_index = node_to_index.Get(node_name_hash); |
| 1809 | if (prev_index == 0) |
| 1810 | { |
| 1811 | node_to_index.Put(node_name_hash, node_to_index.Size()); |
| 1812 | } |
| 1813 | } |
| 1814 | |
| 1815 | return node_to_index.Size(); |
| 1816 | } |
| 1817 | |
| 1818 | static void LoadAnimations(Scene* scene, cgltf_data* gltf_data) |
| 1819 | { |
no test coverage detected