mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 23:09:52 +02:00
21484: Updated code to go with PR feedback
This commit is contained in:
parent
e1acf9dbc9
commit
40d339a831
1 changed files with 13 additions and 10 deletions
|
@ -909,13 +909,6 @@ void ModelEntityRenderer::animate(const TypedEntityPointer& entity) {
|
||||||
QVector<JointData> jointsData;
|
QVector<JointData> jointsData;
|
||||||
|
|
||||||
const QVector<FBXAnimationFrame>& frames = _animation->getFramesReference(); // NOTE: getFrames() is too heavy
|
const QVector<FBXAnimationFrame>& frames = _animation->getFramesReference(); // NOTE: getFrames() is too heavy
|
||||||
QStringList animationJointNames = _animation->getGeometry().getJointNames();
|
|
||||||
auto& fbxJoints = _animation->getGeometry().joints;
|
|
||||||
|
|
||||||
auto& originalFbxJoints = _model->getFBXGeometry().joints;
|
|
||||||
auto& originalFbxIndices = _model->getFBXGeometry().jointIndices;
|
|
||||||
|
|
||||||
bool allowTranslation = entity->getAnimationAllowTranslation();
|
|
||||||
int frameCount = frames.size();
|
int frameCount = frames.size();
|
||||||
if (frameCount <= 0) {
|
if (frameCount <= 0) {
|
||||||
return;
|
return;
|
||||||
|
@ -950,6 +943,14 @@ void ModelEntityRenderer::animate(const TypedEntityPointer& entity) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QStringList animationJointNames = _animation->getGeometry().getJointNames();
|
||||||
|
auto& fbxJoints = _animation->getGeometry().joints;
|
||||||
|
|
||||||
|
auto& originalFbxJoints = _model->getFBXGeometry().joints;
|
||||||
|
auto& originalFbxIndices = _model->getFBXGeometry().jointIndices;
|
||||||
|
|
||||||
|
bool allowTranslation = entity->getAnimationAllowTranslation();
|
||||||
|
|
||||||
const QVector<glm::quat>& rotations = frames[_lastKnownCurrentFrame].rotations;
|
const QVector<glm::quat>& rotations = frames[_lastKnownCurrentFrame].rotations;
|
||||||
const QVector<glm::vec3>& translations = frames[_lastKnownCurrentFrame].translations;
|
const QVector<glm::vec3>& translations = frames[_lastKnownCurrentFrame].translations;
|
||||||
|
|
||||||
|
@ -960,9 +961,11 @@ void ModelEntityRenderer::animate(const TypedEntityPointer& entity) {
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
glm::mat4 translationMat;
|
glm::mat4 translationMat;
|
||||||
|
|
||||||
if (allowTranslation && index < translations.size()) {
|
if (allowTranslation) {
|
||||||
translationMat = glm::translate(translations[index]);
|
if(index < translations.size()){
|
||||||
} else if (!allowTranslation && index < animationJointNames.size()){
|
translationMat = glm::translate(translations[index]);
|
||||||
|
}
|
||||||
|
} else if (index < animationJointNames.size()){
|
||||||
QString jointName = fbxJoints[index].name; // Pushing this here so its not done on every entity, with the exceptions of those allowing for translation
|
QString jointName = fbxJoints[index].name; // Pushing this here so its not done on every entity, with the exceptions of those allowing for translation
|
||||||
|
|
||||||
if (originalFbxIndices.contains(jointName)) {
|
if (originalFbxIndices.contains(jointName)) {
|
||||||
|
|
Loading…
Reference in a new issue