diff --git a/data/assets/scene/solarsystem/missions/dawn/vesta.asset b/data/assets/scene/solarsystem/missions/dawn/vesta.asset index 57a1d68144..c806d808fb 100644 --- a/data/assets/scene/solarsystem/missions/dawn/vesta.asset +++ b/data/assets/scene/solarsystem/missions/dawn/vesta.asset @@ -48,10 +48,10 @@ local Vesta = { DestinationFrame = "GALACTIC" } }, + BoundingSphere = 262000, Renderable = { Type = "RenderableModelProjection", GeometryFile = models .. "VestaComet_5000.obj", - BoundingSphereRadius = 262000, Projection = { Sequence = images, SequenceType = "image-sequence", diff --git a/data/assets/scene/solarsystem/missions/rosetta/67p.asset b/data/assets/scene/solarsystem/missions/rosetta/67p.asset index 2c694b7059..0e10b330d3 100644 --- a/data/assets/scene/solarsystem/missions/rosetta/67p.asset +++ b/data/assets/scene/solarsystem/missions/rosetta/67p.asset @@ -46,63 +46,62 @@ local Comet67P = { Identifier = "67P", Parent = Barycenter.Identifier, Transform = { - Rotation = { - Type = "SpiceRotation", - SourceFrame = "67P/C-G_CK", - DestinationFrame = "GALACTIC" - } + Rotation = { + Type = "SpiceRotation", + SourceFrame = "67P/C-G_CK", + DestinationFrame = "GALACTIC" + } }, + BoundingSphere = 5000.0, Renderable = { - Type = "RenderableModelProjection", - GeometryFile = models .. "67P_rotated_5_130.obj", - Projection = { - Sequence = { imagesDestination }, - SequenceType = "image-sequence", - Observer = "ROSETTA", - Target = "CHURYUMOV-GERASIMENKO", - Aberration = "NONE", - TextureMap = true, - ShadowMap = true, + Type = "RenderableModelProjection", + GeometryFile = models .. "67P_rotated_5_130.obj", + Projection = { + Sequence = { imagesDestination }, + SequenceType = "image-sequence", + Observer = "ROSETTA", + Target = "CHURYUMOV-GERASIMENKO", + Aberration = "NONE", + TextureMap = true, + ShadowMap = true, - DataInputTranslation = { - Instrument = { - NAVCAM = { - DetectorType = "Camera", - Spice = { "ROS_NAVCAM-A" } - } - }, - Target = { - Read = { - "TARGET_NAME", - "INSTRUMENT_HOST_NAME", - "INSTRUMENT_ID", - "START_TIME", - "STOP_TIME" - }, - Convert = { - CHURYUMOV = { "CHURYUMOV-GERASIMENKO" }, - ROSETTA = { "ROSETTA" }, - ["ROSETTA-ORBITER"] = { "ROSETTA" }, - CHURYUMOVGERASIMENKO11969R1 = { "CHURYUMOV-GERASIMENKO" }, - CHURYUMOVGERASIMENKO = { "CHURYUMOV-GERASIMENKO" }, - ["CHURYUMOV-GERASIMENKO1(1969R1)"] = { "CHURYUMOV-GERASIMENKO" }, - CALIBRATION = { "CALIBRATION" }, - ALPHALYR = { "ALPHALYR" }, - ZETACAS = { "ZETACAS" } - } + DataInputTranslation = { + Instrument = { + NAVCAM = { + DetectorType = "Camera", + Spice = { "ROS_NAVCAM-A" } } }, - - Instrument = { - Name = "ROS_NAVCAM-A", - Method = "ELLIPSOID", - Aberration = "NONE", - Fovy = 5.00, - Aspect = 1 + Target = { + Read = { + "TARGET_NAME", + "INSTRUMENT_HOST_NAME", + "INSTRUMENT_ID", + "START_TIME", + "STOP_TIME" + }, + Convert = { + CHURYUMOV = { "CHURYUMOV-GERASIMENKO" }, + ROSETTA = { "ROSETTA" }, + ["ROSETTA-ORBITER"] = { "ROSETTA" }, + CHURYUMOVGERASIMENKO11969R1 = { "CHURYUMOV-GERASIMENKO" }, + CHURYUMOVGERASIMENKO = { "CHURYUMOV-GERASIMENKO" }, + ["CHURYUMOV-GERASIMENKO1(1969R1)"] = { "CHURYUMOV-GERASIMENKO" }, + CALIBRATION = { "CALIBRATION" }, + ALPHALYR = { "ALPHALYR" }, + ZETACAS = { "ZETACAS" } + } } - }, + }, - BoundingSphereRadius = 5000.0 + Instrument = { + Name = "ROS_NAVCAM-A", + Method = "ELLIPSOID", + Aberration = "NONE", + Fovy = 5.00, + Aspect = 1 + } + }, }, GUI = { Name = "67P Churymov-Gerasimenko", diff --git a/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp b/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp index 5acf6ecefd..9030983ff3 100644 --- a/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp +++ b/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp @@ -108,12 +108,6 @@ namespace { // [[codegen::verbatim(PerformShadingInfo.description)]] std::optional performShading; - - // The radius of the bounding sphere of this object. This has to be a - // radius that is larger than anything that is rendered by it. It has to - // be at least as big as the convex hull of the object. The default value - // is 10e9 meters. - std::optional boundingSphereRadius; }; #include "renderablemodelprojection_codegen.cpp" } // namespace @@ -171,12 +165,6 @@ RenderableModelProjection::RenderableModelProjection(const ghoul::Dictionary& di addPropertySubOwner(_projectionComponent); _projectionComponent.initialize(identifier(), p.projection); - if (p.boundingSphereRadius.has_value()) { - _shouldOverrideBoundingSphere = true; - double boundingSphereRadius = p.boundingSphereRadius.value(); - setBoundingSphere(boundingSphereRadius); - } - _performShading = p.performShading.value_or(_performShading); addProperty(_performShading); } @@ -254,14 +242,12 @@ ghoul::opengl::Texture& RenderableModelProjection::baseTexture() const { void RenderableModelProjection::render(const RenderData& data, RendererTasks&) { // Update boundingsphere - if (!_shouldOverrideBoundingSphere) { - setBoundingSphere(_geometry->boundingRadius() * _modelScale * - glm::compMax(data.modelTransform.scale) - ); + setBoundingSphere(_geometry->boundingRadius() * _modelScale * + glm::compMax(data.modelTransform.scale) + ); - // Set Interaction sphere size to be 10% of the bounding sphere - setInteractionSphere(_boundingSphere * 0.1); - } + // Set Interaction sphere size to be 10% of the bounding sphere + setInteractionSphere(_boundingSphere * 0.1); if (_projectionComponent.needsClearProjection()) { _projectionComponent.clearAllProjections(); diff --git a/modules/spacecraftinstruments/rendering/renderablemodelprojection.h b/modules/spacecraftinstruments/rendering/renderablemodelprojection.h index 420d0eaaac..14627c14ea 100644 --- a/modules/spacecraftinstruments/rendering/renderablemodelprojection.h +++ b/modules/spacecraftinstruments/rendering/renderablemodelprojection.h @@ -85,7 +85,6 @@ private: UniformCache(ProjectorMatrix, ModelTransform) _depthFboUniformCache; std::unique_ptr _geometry; - bool _shouldOverrideBoundingSphere = false; double _modelScale = 1.0; bool _invertModelScale = false; bool _forceRenderInvisible = false;