Browse Source

Scale handle functional

Marko Pintera 10 years ago
parent
commit
0630c3c17e
3 changed files with 11 additions and 12 deletions
  1. 1 1
      BansheeEditor/Source/BsEditorSettings.cpp
  2. 10 10
      MBansheeEditor/Scene/ScaleHandle.cs
  3. 0 1
      TODO.txt

+ 1 - 1
BansheeEditor/Source/BsEditorSettings.cpp

@@ -5,6 +5,6 @@ namespace BansheeEngine
 	EditorSettings::EditorSettings()
 		:mMoveSnapActive(false), mRotateSnapActive(false), mMoveSnap(0.1f), mRotationSnap(20.0f), 
 		mGridSize(256), mGridAxisSpacing(1.0f), mGridMajorAxisSpacing(10), mGridAxisMarkerSpacing(25), 
-		mHandleSize(0.15f), mHash(0), mActiveSceneTool(1 /* Move */), mActiveCoordinateMode(0), mActivePivotMode(0)
+		mHandleSize(0.10f), mHash(0), mActiveSceneTool(1 /* Move */), mActiveCoordinateMode(0), mActivePivotMode(0)
 	{ }
 }

+ 10 - 10
MBansheeEditor/Scene/ScaleHandle.cs

@@ -34,7 +34,7 @@ namespace BansheeEditor
             yAxis = new HandleSliderLine(this, Vector3.yAxis, 1.0f);
             zAxis = new HandleSliderLine(this, Vector3.zAxis, 1.0f);
 
-            freeAxis = new HandleSliderPlane(this, Vector3.xAxis, Vector3.yAxis, 0.6f);
+            freeAxis = new HandleSliderPlane(this, Vector3.xAxis, Vector3.yAxis, 0.4f);
         }
 
         protected override void PreInput()
@@ -48,7 +48,7 @@ namespace BansheeEditor
             zAxis.Rotation = rotation;
 
             float handleSize = Handles.GetHandleSize(EditorApplication.SceneViewCamera, position);
-            Vector3 freeAxisOffset = (Vector3.xAxis * -0.3f + Vector3.yAxis * -0.3f) * handleSize;
+            Vector3 freeAxisOffset = (Vector3.xAxis * -0.2f + Vector3.yAxis * -0.2f) * handleSize;
             freeAxis.Rotation = EditorApplication.SceneViewCamera.SceneObject.Rotation;
             freeAxis.Position = position + freeAxis.Rotation.Rotate(freeAxisOffset);
         }
@@ -57,10 +57,10 @@ namespace BansheeEditor
         {
             delta = Vector3.zero;
 
-            delta += xAxis.Delta * GetXDir() * 0.01f;
-            delta += yAxis.Delta * GetYDir() * 0.01f;
-            delta += zAxis.Delta * GetZDir() * 0.01f;
-            delta += (freeAxis.Delta.x + freeAxis.Delta.y) * Vector3.one * 0.01f;
+            delta += xAxis.Delta * GetXDir() * 0.1f;
+            delta += yAxis.Delta * GetYDir() * 0.1f;
+            delta += zAxis.Delta * GetZDir() * 0.1f;
+            delta += (freeAxis.Delta.x + freeAxis.Delta.y) * Vector3.one * 0.1f;
         }
 
         protected override void Draw()
@@ -119,10 +119,10 @@ namespace BansheeEditor
                 HandleDrawing.SetColor(Color.White);
 
             //// Rotate it so it always faces the camera, and move it forward a bit to always render in front
-            Vector3 bottomLeft = -Vector3.xAxis * 0.3f - Vector3.yAxis * 0.3f;
-            Vector3 topLeft = -Vector3.xAxis * 0.3f + Vector3.yAxis * 0.3f;
-            Vector3 topRight = Vector3.xAxis * 0.3f + Vector3.yAxis * 0.3f;
-            Vector3 bottomRight = Vector3.xAxis * 0.3f - Vector3.yAxis * 0.3f;
+            Vector3 bottomLeft = -Vector3.xAxis * 0.2f - Vector3.yAxis * 0.2f;
+            Vector3 topLeft = -Vector3.xAxis * 0.2f + Vector3.yAxis * 0.2f;
+            Vector3 topRight = Vector3.xAxis * 0.2f + Vector3.yAxis * 0.2f;
+            Vector3 bottomRight = Vector3.xAxis * 0.2f - Vector3.yAxis * 0.2f;
 
             Vector3 offset = Vector3.zAxis*0.1f;
 

+ 0 - 1
TODO.txt

@@ -59,7 +59,6 @@ Code quality improvements:
 Polish stage 1
 
 Handles:
-Move plane handles could be more precise
 Investigate scale and its issues
 Check multi-select move/Rotate/scale
 Free rotation handle doesn't seem to be implemented