mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-24 04:58:59 -05:00
Using log2 for calculating desired split level, but have to fake earth radius in ChunkLodGlobe
This commit is contained in:
@@ -55,9 +55,9 @@ namespace openspace {
|
||||
ChunkLodGlobe::ChunkLodGlobe(const ghoul::Dictionary& dictionary)
|
||||
: _leftRoot(new ChunkNode(*this, LEFT_HEMISPHERE))
|
||||
, _rightRoot(new ChunkNode(*this, RIGHT_HEMISPHERE))
|
||||
, globeRadius(6.3e6)
|
||||
, globeRadius(1.6*6.3e6)
|
||||
, minSplitDepth(1)
|
||||
, maxSplitDepth(7)
|
||||
, maxSplitDepth(15)
|
||||
, _rotation("rotation", "Rotation", 0, 0, 360)
|
||||
{
|
||||
std::string name;
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <modules/globebrowsing/rendering/patchrenderer.h>
|
||||
|
||||
// open space includes
|
||||
#include <openspace/engine/wrapper/windowwrapper.h>
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/rendering/renderengine.h>
|
||||
|
||||
@@ -103,10 +104,12 @@ namespace openspace {
|
||||
|
||||
// TODO : Model transform should be fetched as a matrix directly.
|
||||
mat4 modelTransform = translate(mat4(1), data.position.vec3());
|
||||
mat4 modelViewProjectionTransform = data.camera.projectionMatrix()
|
||||
* viewTransform * modelTransform;
|
||||
|
||||
LatLon swCorner = patch.southWestCorner();
|
||||
|
||||
_programObject->setUniform("modelViewProjectionTransform", data.camera.projectionMatrix() * viewTransform * modelTransform);
|
||||
_programObject->setUniform("modelViewProjectionTransform", modelViewProjectionTransform);
|
||||
_programObject->setUniform("minLatLon", vec2(swCorner.lat, swCorner.lon));
|
||||
_programObject->setUniform("latLonScalingFactor", 2.0f * vec2(patch.halfSize.lat, patch.halfSize.lon));
|
||||
_programObject->setUniform("globeRadius", float(radius));
|
||||
|
||||
@@ -70,6 +70,8 @@ namespace openspace {
|
||||
// Mainly for debugging purposes @AA
|
||||
addProperty(_rotation);
|
||||
|
||||
setBoundingSphere(pss(6.0e4, 0));
|
||||
|
||||
//addSwitchValue(std::shared_ptr<ClipMapGlobe>(new ClipMapGlobe(dictionary)), 1e9);
|
||||
addSwitchValue(std::shared_ptr<ChunkLodGlobe>(new ChunkLodGlobe(dictionary)), 1e9);
|
||||
addSwitchValue(std::shared_ptr<GlobeMesh>(new GlobeMesh(dictionary)), 1e10);
|
||||
|
||||
Reference in New Issue
Block a user