Showing the changes to interface/src/MetavoxelSystem.cpp (1 of 6 files). Show all
Unified · Split
| @@ -9,6 +9,8 @@ · 8 unmodified lines | ||
| 9 | 9 | #include <QMutexLocker> |
| 10 | 10 | #include <QtDebug> |
| 11 | 11 | |
| 12 | +#include <glm/gtx/transform.hpp> | |
| 13 | + | |
| 12 | 14 | #include <SharedUtil.h> |
| 13 | 15 | |
| 14 | 16 | #include <MetavoxelUtil.h> |
| @@ -274,6 +276,14 @@ void StaticModelRenderer::init(Spanner* spanner) { · 259 unmodified lines | ||
| 274 | 276 | } |
| 275 | 277 | |
| 276 | 278 | void StaticModelRenderer::simulate(float deltaTime) { |
| 279 | + // update the bounds | |
| 280 | + Box bounds; | |
| 281 | + if (_model->isActive()) { | |
| 282 | + const Extents& extents = _model->getGeometry()->getFBXGeometry().meshExtents; | |
| 283 | + bounds = Box(extents.minimum, extents.maximum); | |
| 284 | + } | |
| 285 | + static_cast<StaticModel*>(parent())->setBounds(glm::translate(_model->getTranslation()) * | |
| 286 | + glm::mat4_cast(_model->getRotation()) * glm::scale(_model->getScale()) * bounds); | |
| 277 | 287 | _model->simulate(deltaTime); |
| 278 | 288 | } |
| 279 | 289 | |