Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
Expose orbitdirection to lua
Browse files Browse the repository at this point in the history
  • Loading branch information
Causeless committed Nov 5, 2023
1 parent 7ae6479 commit 24c7cce
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
1 change: 1 addition & 0 deletions Lua/LuaBindingsManagers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ namespace RTE {
.property("SceneHeight", &SceneMan::GetSceneHeight)
.property("SceneWrapsX", &SceneMan::SceneWrapsX)
.property("SceneWrapsY", &SceneMan::SceneWrapsY)
.property("SceneOrbitDirection", &SceneMan::GetSceneOrbitDirection)
.property("LayerDrawMode", &SceneMan::GetLayerDrawMode, &SceneMan::SetLayerDrawMode)
.property("GlobalAcc", &SceneMan::GetGlobalAcc)
.property("OzPerKg", &SceneMan::GetOzPerKg)
Expand Down
18 changes: 16 additions & 2 deletions Managers/SceneMan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,13 +421,27 @@ bool SceneMan::SceneWrapsY() const

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Directions SceneMan::GetSceneOrbitDirection() const {
if (m_pCurrentScene) {
SLTerrain *terrain = m_pCurrentScene->GetTerrain();
if (terrain) {
return terrain->GetOrbitDirection();
}
}

return Directions::Up;
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

SLTerrain * SceneMan::GetTerrain()
{
// RTEAssert(m_pCurrentScene, "Trying to get terrain matter before there is a scene or terrain!");
if (m_pCurrentScene)
if (m_pCurrentScene) {
return m_pCurrentScene->GetTerrain();
}

return 0;
return nullptr;
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
6 changes: 6 additions & 0 deletions Managers/SceneMan.h
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,12 @@ class SceneMan : public Singleton<SceneMan>, public Serializable {

bool SceneWrapsY() const;

/// <summary>
/// Gets the orbit direction for the current scene.
/// </summary>
/// <returns>The orbit direction for the current scene.</returns>
Directions GetSceneOrbitDirection() const;

//////////////////////////////////////////////////////////////////////////////////////////
// Method: GetTerrain
//////////////////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 24c7cce

Please sign in to comment.