mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-13 17:09:05 -05:00
Adapt to new master: Pointer notation for globals
This commit is contained in:
@@ -82,11 +82,11 @@ void AtNodeNavigator::updateCamera(double deltaTime) {
|
||||
}
|
||||
|
||||
Camera* AtNodeNavigator::camera() const {
|
||||
return global::navigationHandler.camera();
|
||||
return global::navigationHandler->camera();
|
||||
}
|
||||
|
||||
const SceneGraphNode* AtNodeNavigator::anchor() const {
|
||||
return global::navigationHandler.anchorNode();
|
||||
return global::navigationHandler->anchorNode();
|
||||
}
|
||||
|
||||
// Move along the right vector for the camera, while looking at the center of the node
|
||||
|
||||
@@ -157,11 +157,11 @@ AutoNavigationHandler::AutoNavigationHandler()
|
||||
AutoNavigationHandler::~AutoNavigationHandler() {} // NOLINT
|
||||
|
||||
Camera* AutoNavigationHandler::camera() const {
|
||||
return global::navigationHandler.camera();
|
||||
return global::navigationHandler->camera();
|
||||
}
|
||||
|
||||
const SceneGraphNode* AutoNavigationHandler::anchor() const {
|
||||
return global::navigationHandler.anchorNode();
|
||||
return global::navigationHandler->anchorNode();
|
||||
}
|
||||
|
||||
bool AutoNavigationHandler::hasFinished() const {
|
||||
@@ -211,7 +211,7 @@ void AutoNavigationHandler::updateCamera(double deltaTime) {
|
||||
// navigation when we reach the end.
|
||||
std::string currentAnchor = anchor()->identifier();
|
||||
if (currentAnchor != newAnchor) {
|
||||
global::navigationHandler.orbitalNavigator().setAnchorNode(newAnchor);
|
||||
global::navigationHandler->orbitalNavigator().setAnchorNode(newAnchor);
|
||||
}
|
||||
|
||||
if (!_includeRoll) {
|
||||
@@ -296,10 +296,10 @@ void AutoNavigationHandler::startPath() {
|
||||
);
|
||||
|
||||
// TODO: remove this line at the end of our project. Used to simplify testing
|
||||
global::timeManager.setPause(true);
|
||||
global::timeManager->setPause(true);
|
||||
|
||||
//OBS! Until we can handle simulation time: early out if not paused
|
||||
if (!global::timeManager.isPaused()) {
|
||||
if (!global::timeManager->isPaused()) {
|
||||
LERROR("Simulation time must be paused to run a camera path.");
|
||||
return;
|
||||
}
|
||||
@@ -430,7 +430,7 @@ std::vector<glm::dvec3> AutoNavigationHandler::getControlPoints() {
|
||||
Waypoint AutoNavigationHandler::wayPointFromCamera() {
|
||||
const glm::dvec3 pos = camera()->positionVec3();
|
||||
const glm::dquat rot = camera()->rotationQuaternion();
|
||||
const std::string node = global::navigationHandler.anchorNode()->identifier();
|
||||
const std::string node = global::navigationHandler->anchorNode()->identifier();
|
||||
return Waypoint{ pos, rot, node };
|
||||
}
|
||||
|
||||
@@ -654,7 +654,7 @@ Waypoint AutoNavigationHandler::computeDefaultWaypoint(const TargetNodeInstructi
|
||||
|
||||
std::vector<SceneGraphNode*> AutoNavigationHandler::findRelevantNodes() {
|
||||
const std::vector<SceneGraphNode*>& allNodes =
|
||||
global::renderEngine.scene()->allSceneGraphNodes();
|
||||
global::renderEngine->scene()->allSceneGraphNodes();
|
||||
|
||||
const std::vector<std::string> relevantTags = _relevantNodeTags;
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ scripting::LuaLibrary AutoNavigationModule::luaLibrary() const {
|
||||
|
||||
void AutoNavigationModule::internalInitialize(const ghoul::Dictionary&) {
|
||||
global::callback::preSync.emplace_back([this]() {
|
||||
_autoNavigationHandler.updateCamera(global::windowDelegate.deltaTime());
|
||||
_autoNavigationHandler.updateCamera(global::windowDelegate->deltaTime());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace openspace::autonavigation::luascriptfunctions {
|
||||
int continuePath(lua_State* L) {
|
||||
ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::continuePath");
|
||||
|
||||
AutoNavigationModule* module = global::moduleEngine.module<AutoNavigationModule>();
|
||||
AutoNavigationModule* module = global::moduleEngine->module<AutoNavigationModule>();
|
||||
AutoNavigationHandler& handler = module->AutoNavigationHandler();
|
||||
handler.continuePath();
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace openspace::autonavigation::luascriptfunctions {
|
||||
int stopPath(lua_State* L) {
|
||||
ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::stopPath");
|
||||
|
||||
AutoNavigationModule* module = global::moduleEngine.module<AutoNavigationModule>();
|
||||
AutoNavigationModule* module = global::moduleEngine->module<AutoNavigationModule>();
|
||||
AutoNavigationHandler& handler = module->AutoNavigationHandler();
|
||||
handler.abortPath();
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace openspace::autonavigation::luascriptfunctions {
|
||||
|
||||
PathSpecification spec = PathSpecification(TargetNodeInstruction{insDict});
|
||||
|
||||
AutoNavigationModule* module = global::moduleEngine.module<AutoNavigationModule>();
|
||||
AutoNavigationModule* module = global::moduleEngine->module<AutoNavigationModule>();
|
||||
AutoNavigationHandler& handler = module->AutoNavigationHandler();
|
||||
handler.createPath(spec);
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace openspace::autonavigation::luascriptfunctions {
|
||||
);
|
||||
}
|
||||
|
||||
AutoNavigationModule* module = global::moduleEngine.module<AutoNavigationModule>();
|
||||
AutoNavigationModule* module = global::moduleEngine->module<AutoNavigationModule>();
|
||||
AutoNavigationHandler& handler = module->AutoNavigationHandler();
|
||||
handler.createPath(spec);
|
||||
|
||||
@@ -160,7 +160,7 @@ namespace openspace::autonavigation::luascriptfunctions {
|
||||
|
||||
LINFOC("AutoNavigationModule", "Reading succeeded. Creating path");
|
||||
|
||||
AutoNavigationModule* module = global::moduleEngine.module<AutoNavigationModule>();
|
||||
AutoNavigationModule* module = global::moduleEngine->module<AutoNavigationModule>();
|
||||
AutoNavigationHandler& handler = module->AutoNavigationHandler();
|
||||
handler.createPath(spec);
|
||||
|
||||
@@ -176,7 +176,7 @@ namespace openspace::autonavigation::luascriptfunctions {
|
||||
const int pointsPerSegment = (int)ghoul::lua::value<lua_Number>(L, 1);
|
||||
|
||||
// Get sample positions from the current curve
|
||||
AutoNavigationModule* module = global::moduleEngine.module<AutoNavigationModule>();
|
||||
AutoNavigationModule* module = global::moduleEngine->module<AutoNavigationModule>();
|
||||
AutoNavigationHandler& handler = module->AutoNavigationHandler();
|
||||
std::vector<glm::dvec3> points = handler.getCurvePositions(pointsPerSegment);
|
||||
|
||||
@@ -211,7 +211,7 @@ namespace openspace::autonavigation::luascriptfunctions {
|
||||
const int pointsPerSegment = (int)ghoul::lua::value<lua_Number>(L, 1);
|
||||
|
||||
// Get sample positions from the current curve
|
||||
AutoNavigationModule* module = global::moduleEngine.module<AutoNavigationModule>();
|
||||
AutoNavigationModule* module = global::moduleEngine->module<AutoNavigationModule>();
|
||||
AutoNavigationHandler& handler = module->AutoNavigationHandler();
|
||||
std::vector<glm::dquat> orientations = handler.getCurveOrientations(pointsPerSegment);
|
||||
|
||||
@@ -248,7 +248,7 @@ namespace openspace::autonavigation::luascriptfunctions {
|
||||
const int pointsPerSegment = (int)ghoul::lua::value<lua_Number>(L, 1);
|
||||
|
||||
// Get sample positions from the current curve
|
||||
AutoNavigationModule* module = global::moduleEngine.module<AutoNavigationModule>();
|
||||
AutoNavigationModule* module = global::moduleEngine->module<AutoNavigationModule>();
|
||||
AutoNavigationHandler& handler = module->AutoNavigationHandler();
|
||||
std::vector<glm::dvec3> viewDirections = handler.getCurveViewDirections(pointsPerSegment);
|
||||
|
||||
@@ -283,7 +283,7 @@ namespace openspace::autonavigation::luascriptfunctions {
|
||||
ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::getControlPoints");
|
||||
|
||||
// Get sample positions from the current curve
|
||||
AutoNavigationModule* module = global::moduleEngine.module<AutoNavigationModule>();
|
||||
AutoNavigationModule* module = global::moduleEngine->module<AutoNavigationModule>();
|
||||
AutoNavigationHandler& handler = module->AutoNavigationHandler();
|
||||
std::vector<glm::dvec3> points = handler.getControlPoints();
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace {
|
||||
namespace openspace::autonavigation {
|
||||
|
||||
AvoidCollisionCurve::AvoidCollisionCurve(const Waypoint& start, const Waypoint& end) {
|
||||
AutoNavigationModule* module = global::moduleEngine.module<AutoNavigationModule>();
|
||||
AutoNavigationModule* module = global::moduleEngine->module<AutoNavigationModule>();
|
||||
_relevantNodes = module->AutoNavigationHandler().relevantNodes();
|
||||
|
||||
glm::dvec3 startNodeCenter = start.node()->worldPosition();
|
||||
|
||||
@@ -113,7 +113,7 @@ std::vector<Waypoint> TargetNodeInstruction::getWaypoints() const {
|
||||
targetPos = targetNode->worldPosition() +
|
||||
targetNode->worldRotationMatrix() * position.value();
|
||||
|
||||
Camera* camera = global::navigationHandler.camera();
|
||||
Camera* camera = global::navigationHandler->camera();
|
||||
|
||||
glm::dmat4 lookAtMat = glm::lookAt(
|
||||
targetPos,
|
||||
|
||||
@@ -55,7 +55,7 @@ PathSegment::PathSegment(Waypoint start, Waypoint end, CurveType type,
|
||||
else {
|
||||
_duration = std::log(pathLength());
|
||||
|
||||
auto module = global::moduleEngine.module<AutoNavigationModule>();
|
||||
auto module = global::moduleEngine->module<AutoNavigationModule>();
|
||||
_duration /= module->AutoNavigationHandler().speedScale();
|
||||
}
|
||||
}
|
||||
@@ -85,7 +85,7 @@ CameraPose PathSegment::traversePath(double dt) {
|
||||
return _start.pose;
|
||||
}
|
||||
|
||||
AutoNavigationModule* module = global::moduleEngine.module<AutoNavigationModule>();
|
||||
AutoNavigationModule* module = global::moduleEngine->module<AutoNavigationModule>();
|
||||
AutoNavigationHandler& handler = module->AutoNavigationHandler();
|
||||
const int nrSteps = handler.nrSimulationStepsPerFrame();
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ WaypointNodeDetails::WaypointNodeDetails(const std::string nodeIdentifier) {
|
||||
double WaypointNodeDetails::findValidBoundingSphere(const SceneGraphNode* node) {
|
||||
double bs = static_cast<double>(node->boundingSphere());
|
||||
const double minValidBoundingSphere =
|
||||
global::moduleEngine.module<AutoNavigationModule>()->minValidBoundingSphere();
|
||||
global::moduleEngine->module<AutoNavigationModule>()->minValidBoundingSphere();
|
||||
|
||||
if (bs < minValidBoundingSphere) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user