update model location with SpatiallyNestable's locationChanged call

This commit is contained in:
Seth Alves 2015-12-09 10:42:32 -08:00
parent a580442b92
commit 4d60c7bbc0
2 changed files with 10 additions and 0 deletions

View file

@ -584,3 +584,11 @@ glm::vec3 RenderableModelEntityItem::getAbsoluteJointTranslationInObjectFrame(in
}
return glm::vec3(0.0f);
}
void RenderableModelEntityItem::locationChanged() {
EntityItem::locationChanged();
if (_model && _model->isActive()) {
_model->setRotation(getRotation());
_model->setTranslation(getPosition());
}
}

View file

@ -71,6 +71,8 @@ public:
virtual glm::quat getAbsoluteJointRotationInObjectFrame(int index) const override;
virtual glm::vec3 getAbsoluteJointTranslationInObjectFrame(int index) const override;
void locationChanged();
private:
void remapTextures();