-
Автор темы
- #1
How should i setup playbackrate for my resolver? i am doing it like this and i know its very wrong but its best i got, heres example:
Код:
for (int i = ROTATE_FIRST; i < ROTATE_COUNT; i++)
{
entity->invalidateBoneCache();
std::array<AnimationLayer, 13> BackupLayers{ };
memcpy(BackupLayers.data(), player.layers.data(), entity->getAnimationLayersCount() * sizeof(AnimationLayer));
switch (i) // we dont need to do switch statement but its easier for me
{
case ROTATE_FIRST:
entity->setupBones(player.resolver_matrix[1].data(), MAXSTUDIOBONES, BONE_USED_BY_ANYTHING, entity->simulationTime());
memcpy(player.layers.data(), BackupLayers.data(), entity->getAnimationLayersCount() * sizeof(AnimationLayer));
player.ResolverPlaybackRates.at(1) = player.layers[6].playbackRate;
break;
case ROTATE_SECOND:
entity->setupBones(player.resolver_matrix[2].data(), MAXSTUDIOBONES, BONE_USED_BY_ANYTHING, entity->simulationTime());
memcpy(player.layers.data(), BackupLayers.data(), entity->getAnimationLayersCount() * sizeof(AnimationLayer));
player.ResolverPlaybackRates.at(2) = player.layers[6].playbackRate;
break;
case ROTATE_THIRD:
entity->setupBones(player.resolver_matrix[3].data(), MAXSTUDIOBONES, BONE_USED_BY_ANYTHING, entity->simulationTime());
memcpy(player.layers.data(), BackupLayers.data(), entity->getAnimationLayersCount() * sizeof(AnimationLayer));
player.ResolverPlaybackRates.at(3) = player.layers[6].playbackRate;
break;
}
}