3d-model overlays can now be children

This commit is contained in:
Seth Alves 2016-08-11 15:29:09 -07:00
parent 15e2140cb2
commit c363ca9887
2 changed files with 11 additions and 0 deletions

View file

@ -178,3 +178,12 @@ bool ModelOverlay::findRayIntersectionExtraInfo(const glm::vec3& origin, const g
ModelOverlay* ModelOverlay::createClone() const {
return new ModelOverlay(this);
}
void ModelOverlay::locationChanged(bool tellPhysics) {
Base3DOverlay::locationChanged(tellPhysics);
if (_model && _model->isActive()) {
_model->setRotation(getRotation());
_model->setTranslation(getPosition());
}
}

View file

@ -39,6 +39,8 @@ public:
virtual bool addToScene(Overlay::Pointer overlay, std::shared_ptr<render::Scene> scene, render::PendingChanges& pendingChanges) override;
virtual void removeFromScene(Overlay::Pointer overlay, std::shared_ptr<render::Scene> scene, render::PendingChanges& pendingChanges) override;
void locationChanged(bool tellPhysics) override;
private:
ModelPointer _model;