mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:14:59 +02:00
Merge pull request #7476 from ZappoMan/bugFixes
fix a couple of model bugs
This commit is contained in:
commit
dfb09f134a
3 changed files with 37 additions and 4 deletions
|
@ -354,7 +354,9 @@ void RenderableModelEntityItem::updateModelBounds() {
|
|||
bool movingOrAnimating = isMovingRelativeToParent() || isAnimatingSomething();
|
||||
if ((movingOrAnimating ||
|
||||
_needsInitialSimulation ||
|
||||
_needsJointSimulation ||
|
||||
_model->getTranslation() != getPosition() ||
|
||||
_model->getScaleToFitDimensions() != getDimensions() ||
|
||||
_model->getRotation() != getRotation() ||
|
||||
_model->getRegistrationPoint() != getRegistrationPoint())
|
||||
&& _model->isActive() && _dimensionsInitialized) {
|
||||
|
@ -370,6 +372,7 @@ void RenderableModelEntityItem::updateModelBounds() {
|
|||
}
|
||||
|
||||
_needsInitialSimulation = false;
|
||||
_needsJointSimulation = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -770,6 +773,7 @@ bool RenderableModelEntityItem::setAbsoluteJointRotationInObjectFrame(int index,
|
|||
_absoluteJointRotationsInObjectFrameSet[index] = true;
|
||||
_absoluteJointRotationsInObjectFrameDirty[index] = true;
|
||||
result = true;
|
||||
_needsJointSimulation = true;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
|
@ -785,11 +789,33 @@ bool RenderableModelEntityItem::setAbsoluteJointTranslationInObjectFrame(int ind
|
|||
_absoluteJointTranslationsInObjectFrameSet[index] = true;
|
||||
_absoluteJointTranslationsInObjectFrameDirty[index] = true;
|
||||
result = true;
|
||||
_needsJointSimulation = true;
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
void RenderableModelEntityItem::setJointRotations(const QVector<glm::quat>& rotations) {
|
||||
ModelEntityItem::setJointRotations(rotations);
|
||||
_needsJointSimulation = true;
|
||||
}
|
||||
|
||||
void RenderableModelEntityItem::setJointRotationsSet(const QVector<bool>& rotationsSet) {
|
||||
ModelEntityItem::setJointRotationsSet(rotationsSet);
|
||||
_needsJointSimulation = true;
|
||||
}
|
||||
|
||||
void RenderableModelEntityItem::setJointTranslations(const QVector<glm::vec3>& translations) {
|
||||
ModelEntityItem::setJointTranslations(translations);
|
||||
_needsJointSimulation = true;
|
||||
}
|
||||
|
||||
void RenderableModelEntityItem::setJointTranslationsSet(const QVector<bool>& translationsSet) {
|
||||
ModelEntityItem::setJointTranslationsSet(translationsSet);
|
||||
_needsJointSimulation = true;
|
||||
}
|
||||
|
||||
|
||||
void RenderableModelEntityItem::locationChanged() {
|
||||
EntityItem::locationChanged();
|
||||
if (_model && _model->isActive()) {
|
||||
|
|
|
@ -69,6 +69,11 @@ public:
|
|||
virtual bool setAbsoluteJointRotationInObjectFrame(int index, const glm::quat& rotation) override;
|
||||
virtual bool setAbsoluteJointTranslationInObjectFrame(int index, const glm::vec3& translation) override;
|
||||
|
||||
virtual void setJointRotations(const QVector<glm::quat>& rotations) override;
|
||||
virtual void setJointRotationsSet(const QVector<bool>& rotationsSet) override;
|
||||
virtual void setJointTranslations(const QVector<glm::vec3>& translations) override;
|
||||
virtual void setJointTranslationsSet(const QVector<bool>& translationsSet) override;
|
||||
|
||||
virtual void loader() override;
|
||||
virtual void locationChanged() override;
|
||||
|
||||
|
@ -97,6 +102,8 @@ private:
|
|||
bool _showCollisionHull = false;
|
||||
|
||||
bool getAnimationFrame();
|
||||
|
||||
bool _needsJointSimulation { false };
|
||||
};
|
||||
|
||||
#endif // hifi_RenderableModelEntityItem_h
|
||||
|
|
|
@ -120,10 +120,10 @@ public:
|
|||
virtual glm::vec3 getJointPosition(int jointIndex) const { return glm::vec3(); }
|
||||
virtual glm::quat getJointRotation(int jointIndex) const { return glm::quat(); }
|
||||
|
||||
void setJointRotations(const QVector<glm::quat>& rotations);
|
||||
void setJointRotationsSet(const QVector<bool>& rotationsSet);
|
||||
void setJointTranslations(const QVector<glm::vec3>& translations);
|
||||
void setJointTranslationsSet(const QVector<bool>& translationsSet);
|
||||
virtual void setJointRotations(const QVector<glm::quat>& rotations);
|
||||
virtual void setJointRotationsSet(const QVector<bool>& rotationsSet);
|
||||
virtual void setJointTranslations(const QVector<glm::vec3>& translations);
|
||||
virtual void setJointTranslationsSet(const QVector<bool>& translationsSet);
|
||||
QVector<glm::quat> getJointRotations() const;
|
||||
QVector<bool> getJointRotationsSet() const;
|
||||
QVector<glm::vec3> getJointTranslations() const;
|
||||
|
|
Loading…
Reference in a new issue