Update model bounding sphere to account for parent scale, closes #1630

This commit is contained in:
Malin Ejdbo
2021-06-04 10:16:48 +02:00
parent 6b65a9b305
commit 257d3f8538

View File

@@ -575,7 +575,6 @@ void RenderableModel::initializeGL() {
_geometry->initialize();
_geometry->calculateBoundingRadius();
setBoundingSphere(_geometry->boundingRadius() * _modelScale);
}
void RenderableModel::deinitializeGL() {
@@ -717,6 +716,10 @@ void RenderableModel::update(const UpdateData& data) {
ghoul::opengl::updateUniformLocations(*_program, _uniformCache, UniformNames);
}
setBoundingSphere(_geometry->boundingRadius() * _modelScale *
glm::compMax(data.modelTransform.scale)
);
if (_geometry->hasAnimation() && !_animationStart.empty()) {
double relativeTime;
double now = data.time.j2000Seconds();