Explorar o código

Animation culling now functional
Fixed GUI float field dragging

BearishSun %!s(int64=9) %!d(string=hai) anos
pai
achega
a91a09b954

+ 1 - 1
Source/BansheeEditor/Source/BsGUIFloatField.cpp

@@ -114,7 +114,7 @@ namespace BansheeEngine
 					mLastDragPos = event.getPosition().x + jumpAmount;
 					mLastDragPos = event.getPosition().x + jumpAmount;
 
 
 					if (oldValue != newValue)
 					if (oldValue != newValue)
-						setValue(newValue);
+						valueChanged(newValue);
 				}
 				}
 			}
 			}
 
 

+ 10 - 3
Source/MBansheeEditor/Windows/Animation/AnimationGizmo.cs

@@ -23,11 +23,18 @@ namespace BansheeEditor
             SceneObject so = animation.SceneObject;
             SceneObject so = animation.SceneObject;
 
 
             Gizmos.Color = Color.Green;
             Gizmos.Color = Color.Green;
-            Gizmos.Transform = Matrix4.TRS(so.Position, so.Rotation, Vector3.One);
+            Gizmos.Transform = Matrix4.Identity;
+
+            Matrix4 parentTfrm;
+            if (so.Parent != null)
+                parentTfrm = so.Parent.WorldTransform;
+            else
+                parentTfrm = Matrix4.Identity;
 
 
             AABox bounds = animation.Bounds;
             AABox bounds = animation.Bounds;
-            Vector3 scaledSize = bounds.Size * so.Scale;
-            Gizmos.DrawWireCube(bounds.Center, scaledSize * 0.5f);
+            bounds.TransformAffine(parentTfrm);
+
+            Gizmos.DrawWireCube(bounds.Center, bounds.Size * 0.5f);
         }
         }
     }
     }
 
 

+ 16 - 2
Source/MBansheeEngine/Animation/Animation.cs

@@ -135,7 +135,14 @@ namespace BansheeEngine
                     if (_native != null)
                     if (_native != null)
                     {
                     {
                         AABox bounds = serializableData.bounds;
                         AABox bounds = serializableData.bounds;
-                        bounds.TransformAffine(SceneObject.WorldTransform);
+
+                        Matrix4 parentTfrm;
+                        if (SceneObject.Parent != null)
+                            parentTfrm = SceneObject.Parent.WorldTransform;
+                        else
+                            parentTfrm = Matrix4.Identity;
+
+                        bounds.TransformAffine(parentTfrm);
 
 
                         _native.Bounds = bounds;
                         _native.Bounds = bounds;
                     }
                     }
@@ -790,7 +797,14 @@ namespace BansheeEngine
                 if (_native != null)
                 if (_native != null)
                 {
                 {
                     AABox bounds = serializableData.bounds;
                     AABox bounds = serializableData.bounds;
-                    bounds.TransformAffine(SceneObject.WorldTransform);
+
+                    Matrix4 parentTfrm;
+                    if (SceneObject.Parent != null)
+                        parentTfrm = SceneObject.Parent.WorldTransform;
+                    else
+                        parentTfrm = Matrix4.Identity;
+
+                    bounds.TransformAffine(parentTfrm);
 
 
                     _native.Bounds = bounds;
                     _native.Bounds = bounds;
                 }
                 }