mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 17:00:36 +02:00
Preliminary Research Complete
Found the part that needs updating with the AnimationProperty
This commit is contained in:
parent
4acccb6ace
commit
34d9e9b371
1 changed files with 13 additions and 3 deletions
|
@ -282,7 +282,8 @@ bool RenderableModelEntityItem::getAnimationFrame() {
|
|||
|
||||
const QVector<FBXAnimationFrame>& frames = animation->getFramesReference(); // NOTE: getFrames() is too heavy
|
||||
auto& fbxJoints = animation->getGeometry().joints;
|
||||
|
||||
auto& originalFbxJoints = _model->getFBXGeometry().joints; // model-> isLoaded above makes sure this doesnt crash to an assert!
|
||||
|
||||
int frameCount = frames.size();
|
||||
if (frameCount > 0) {
|
||||
int animationCurrentFrame = (int)(glm::floor(getAnimationCurrentFrame())) % frameCount;
|
||||
|
@ -309,9 +310,18 @@ bool RenderableModelEntityItem::getAnimationFrame() {
|
|||
int index = _jointMapping[j];
|
||||
if (index >= 0) {
|
||||
glm::mat4 translationMat;
|
||||
if (index < translations.size()) {
|
||||
|
||||
bool _removeme_flag = false;
|
||||
// this is the part to attack.
|
||||
// S omethings off even with the original Joints.
|
||||
if (!_removeme_flag ){
|
||||
|
||||
translationMat = glm::translate(originalFbxJoints[index].translation);
|
||||
|
||||
} else if (_removeme_flag && index < translations.size()) {
|
||||
translationMat = glm::translate(translations[index]);
|
||||
}
|
||||
}
|
||||
|
||||
glm::mat4 rotationMat;
|
||||
if (index < rotations.size()) {
|
||||
rotationMat = glm::mat4_cast(fbxJoints[index].preRotation * rotations[index] * fbxJoints[index].postRotation);
|
||||
|
|
Loading…
Reference in a new issue