Skip to content

Commit

Permalink
- fix euler conversion using rad instead of degrees
Browse files Browse the repository at this point in the history
- clean up manager shutdown in application layer
- enable grid by default for now
  • Loading branch information
kaffeewolf committed Nov 23, 2024
1 parent aaed699 commit 5cde9a5
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions code/addons/audiofeature/managers/audiomanager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ AudioManager::OnActivate()
{
using namespace Game;
using namespace Audio;
Game::Manager::OnActivate();

Game::World* world = Game::GetWorld(WORLD_DEFAULT);

Expand Down
4 changes: 4 additions & 0 deletions code/addons/graphicsfeature/graphicsfeatureunit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,10 @@ GraphicsFeatureUnit::OnActivate()
void
GraphicsFeatureUnit::OnDeactivate()
{
this->RemoveManager(this->cameraManager);
this->RemoveManager(this->graphicsManager);
this->cameraManager = nullptr;
this->graphicsManager = nullptr;
Im3d::Im3dContext::Discard();
Dynui::ImguiContext::Discard();
StaticUI::StaticUIContext::Discard();
Expand Down
2 changes: 0 additions & 2 deletions code/addons/graphicsfeature/managers/cameramanager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ CameraManager::OnDeactivate()
{
Manager::OnDeactivate();
n_assert(CameraManager::HasInstance());
delete CameraManager::Singleton;
CameraManager::Singleton = nullptr;
}

//------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion code/addons/physicsfeature/managers/physicsmanager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ PhysicsManager::OnActivate()
void
PhysicsManager::OnDeactivate()
{
Game::Manager::OnActivate();
Game::Manager::OnDeactivate();
}

//------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion code/foundation/math/mat4.cc
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ vec3 aseuler(const mat4& m)
x = z;
z = t;
}
return vec3(x, y, z);
return vec3(Math::rad2deg(x), Math::rad2deg(y), Math::rad2deg(z));
}


Expand Down
5 changes: 5 additions & 0 deletions toolkit/editor/editorfeature/editorfeatureunit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "graphicsfeature/components/model.h"
#include "graphicsfeature/components/decal.h"
#include "graphicsfeature/components/lighting.h"
#include "dynui/im3d/im3dcontext.h"

// TEMP: Move this to editor game manager
#include "game/world.h"
Expand Down Expand Up @@ -67,6 +68,10 @@ EditorFeatureUnit::OnActivate()

this->AttachManager(Editor::UIManager::Create());

Im3d::Im3dContext::SetGridStatus(true);
Im3d::Im3dContext::SetGridSize(1.0f, 25);
Im3d::Im3dContext::SetGridColor(Math::vec4(0.2f, 0.2f, 0.2f, 0.8f));

Editor::Start();

// TODO: move this to a game manager that is created by the editor
Expand Down

0 comments on commit 5cde9a5

Please sign in to comment.