mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-14 01:10:11 -05:00
Add Lua function to ask module if a camera path is running
This commit is contained in:
@@ -73,6 +73,13 @@ scripting::LuaLibrary AutoNavigationModule::luaLibrary() const {
|
||||
absPath("${MODULE_AUTONAVIGATION}/scripts/rendering.lua")
|
||||
};
|
||||
res.functions = {
|
||||
{
|
||||
"isFlying",
|
||||
&autonavigation::luascriptfunctions::isFlying,
|
||||
{},
|
||||
"",
|
||||
"Returns true if a camera path is currently running, and false otherwise."
|
||||
},
|
||||
{
|
||||
"continuePath",
|
||||
&autonavigation::luascriptfunctions::continuePath,
|
||||
|
||||
@@ -43,6 +43,17 @@ namespace openspace::autonavigation::luascriptfunctions {
|
||||
|
||||
const double Epsilon = 1e-12;
|
||||
|
||||
int isFlying(lua_State* L) {
|
||||
ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::isFlying");
|
||||
|
||||
AutoNavigationModule* module = global::moduleEngine->module<AutoNavigationModule>();
|
||||
bool hasFinished = module->AutoNavigationHandler().hasFinished();
|
||||
|
||||
ghoul::lua::push(L, !hasFinished);
|
||||
ghoul_assert(lua_gettop(L) == 1, "Incorrect number of items left on stack");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int continuePath(lua_State* L) {
|
||||
ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::continuePath");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user