Browse Source

Code review fix: Moved the ToggleGrid() to the SceneView3D OnEvent() instead of HandleUpdate().https://github.com/LumaDigital/AtomicGameEngine/commit/e0b3e6c04fd8008dac119f2541304345127f35f7#commitcomment-17332625

Fixed a bug I found in the grid.
weinand 9 years ago
parent
commit
d15ca88c50

+ 1 - 1
Source/Atomic/Graphics/Camera.h

@@ -31,7 +31,7 @@ namespace Atomic
 {
 
 static const float DEFAULT_NEARCLIP = 0.1f;
-static const float DEFAULT_FARCLIP = 200.0f;
+static const float DEFAULT_FARCLIP = 1000.0f;
 static const float DEFAULT_CAMERA_FOV = 45.0f;
 static const float DEFAULT_ORTHOSIZE = 20.0f;
 

+ 1 - 1
Source/Atomic/Graphics/DebugRenderer.cpp

@@ -56,7 +56,7 @@ DebugRenderer::DebugRenderer(Context* context) :
     position1_(0, 0, 0),
     position2_(0, 0, 0),
     position3_(0, 0, 0),
-    numGridLines_(200),
+    numGridLines_(100),
     scale_(0),
     lineLength_(0),
     offset_(0),

+ 2 - 2
Source/AtomicEditor/Editors/SceneEditor3D/SceneView3D.cpp

@@ -513,6 +513,8 @@ bool SceneView3D::OnEvent(const TBWidgetEvent &ev)
             sceneEditor_->GetSelection()->Clear();
         }
     }
+    if (ev.type == EVENT_TYPE_KEY_DOWN)
+        ToggleGrid();
 
     return sceneEditor_->OnEvent(ev);
 }
@@ -538,8 +540,6 @@ void SceneView3D::HandleUpdate(StringHash eventType, VariantMap& eventData)
 
     QueueUpdate();
 
-    ToggleGrid();
-
     if (gridEnabled_)
     {
         int cameraYPos = cameraNode_->GetPosition().y_;