Просмотр исходного кода

Refresh handle as soon as it changes and make move handle the default

Marko Pintera 11 лет назад
Родитель
Сommit
0683c43fd8

+ 1 - 1
BansheeEditor/Source/BsEditorSettings.cpp

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

+ 6 - 3
MBansheeEditor/Scene/RotateHandle.cs

@@ -73,10 +73,13 @@ namespace BansheeEditor
             delta = Quaternion.FromAxisAngle(GetYDir(), yValue) * delta;
             delta = Quaternion.FromAxisAngle(GetYDir(), yValue) * delta;
             delta = Quaternion.FromAxisAngle(GetZDir(), zValue) * delta;
             delta = Quaternion.FromAxisAngle(GetZDir(), zValue) * delta;
 
 
-            Matrix4 cameraToWorld = EditorApplication.SceneViewCamera.ViewMatrixInverse;
+            if (freeAxis.State == HandleSlider.StateType.Active)
+            {
+                Matrix4 cameraToWorld = EditorApplication.SceneViewCamera.ViewMatrixInverse;
 
 
-            Vector3 rotDir = cameraToWorld.MultiplyAffine(new Vector3(-Input.PointerDelta.y, -Input.PointerDelta.x, 0));
-            delta = Quaternion.FromAxisAngle(rotDir.Normalized, Input.PointerDelta.Magnitude) * delta;
+                Vector3 rotDir = cameraToWorld.MultiplyAffine(new Vector3(-Input.PointerDelta.y, -Input.PointerDelta.x, 0));
+                delta = Quaternion.FromAxisAngle(rotDir.Normalized, Input.PointerDelta.Magnitude)*delta;
+            }
         }
         }
 
 
         protected override void Draw()
         protected override void Draw()

+ 2 - 2
MBansheeEditor/Scene/SceneWindow.cs

@@ -176,9 +176,9 @@ namespace BansheeEditor
                         sceneViewHandler.PickObject(scenePos, ctrlHeld);
                         sceneViewHandler.PickObject(scenePos, ctrlHeld);
                     }
                     }
                 }
                 }
-
-                sceneViewHandler.UpdateHandle(scenePos, Input.PointerDelta);
             }
             }
+
+            sceneViewHandler.UpdateHandle(scenePos, Input.PointerDelta);
         }
         }
 
 
         protected override void WindowResized(int width, int height)
         protected override void WindowResized(int width, int height)

+ 0 - 1
TODO.txt

@@ -7,7 +7,6 @@ Possibly set up automatic refresh in debug mode after initialization? As an ad-h
 
 
 <<<<<<Handles>>>>>>>>
 <<<<<<Handles>>>>>>>>
 
 
-Rotation is really really jerky
 Free rotate doesn't really work
 Free rotate doesn't really work
 When scaling using center make sure to offset the object before scale
 When scaling using center make sure to offset the object before scale