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

Method Interpolate

src/Nazara/Utility/Skeleton.cpp:252–286  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250 }
251
252 void Skeleton::Interpolate(const Skeleton& skeletonA, const Skeleton& skeletonB, float interpolation)
253 {
254 #if NAZARA_UTILITY_SAFE
255 if (!m_impl)
256 {
257 NazaraError("Skeleton not created");
258 return;
259 }
260
261 if (!skeletonA.IsValid())
262 {
263 NazaraError("Skeleton A is invalid");
264 return;
265 }
266
267 if (!skeletonB.IsValid())
268 {
269 NazaraError("Skeleton B is invalid");
270 return;
271 }
272
273 if (skeletonA.GetJointCount() != skeletonB.GetJointCount() || m_impl->joints.size() != skeletonA.GetJointCount())
274 {
275 NazaraError("Skeletons must have the same joint count");
276 return;
277 }
278 #endif
279
280 Joint* jointsA = &skeletonA.m_impl->joints[0];
281 Joint* jointsB = &skeletonB.m_impl->joints[0];
282 for (std::size_t i = 0; i < m_impl->joints.size(); ++i)
283 m_impl->joints[i].Interpolate(jointsA[i], jointsB[i], interpolation, CoordSys_Local);
284
285 InvalidateJoints();
286 }
287
288 void Skeleton::Interpolate(const Skeleton& skeletonA, const Skeleton& skeletonB, float interpolation, UInt32* indices, UInt32 indiceCount)
289 {

Callers

nothing calls this directly

Calls 2

IsValidMethod · 0.45
GetJointCountMethod · 0.45

Tested by

no test coverage detected