virtual public bool DoneTransformation(bool bEmitChange) { curChange.parentAfter = GetLocalFrame(CoordSpace.SceneCoords); curChange.parentScaleAfter = GetLocalScale(); // discard this transformation if nothing happened if (curChange.parentBefore.EpsilonEqual(curChange.parentAfter, MathUtil.ZeroTolerancef) && curChange.parentScaleBefore.EpsilonEqual(curChange.parentScaleAfter, MathUtil.ZeroTolerancef)) { return(false); } if (target.IsTemporary) { curChange.after = new List <Frame3f>(); curChange.scaleAfter = new List <Vector3f>(); foreach (SceneObject so in curChange.childSOs) { curChange.after.Add(so.GetLocalFrame(CoordSpace.SceneCoords)); curChange.scaleAfter.Add(UnityUtil.GetFreeLocalScale(so.RootGameObject)); } } if (bEmitChange) { target.GetScene().History.PushChange(curChange, true); } curChange = null; return(true); }
public TransformGizmoChange change; // [TODO] shouldn't be using gizmo change for this? public GrabInfo(SceneObject so, Frame3f handF) { this.so = so; this.startHandF = handF; this.startObjFW = so.GetLocalFrame(CoordSpace.WorldCoords); this.startObjRelF = this.startHandF.ToFrame(this.startObjFW); this.stickDelta = Vector2f.Zero; change = new TransformGizmoChange() { parentSO = new WeakReference(so), parentBefore = so.GetLocalFrame(CoordSpace.SceneCoords), parentScaleBefore = so.GetLocalScale() }; }
virtual public bool DoneTransformation() { curChange.parentAfter = GetLocalFrame(CoordSpace.SceneCoords); curChange.parentScaleAfter = GetLocalScale(); if (target.IsTemporary) { curChange.after = new List <Frame3f>(); curChange.scaleAfter = new List <Vector3f>(); foreach (TransformableSO so in curChange.childSOs) { curChange.after.Add(so.GetLocalFrame(CoordSpace.SceneCoords)); curChange.scaleAfter.Add(UnityUtil.GetFreeLocalScale(so.RootGameObject)); } } target.GetScene().History.PushChange(curChange, true); curChange = null; return(true); }
virtual public void BeginTransformation() { curChange = new TransformGizmoChange(); curChange.parentSO = new WeakReference(Target); curChange.parentBefore = GetLocalFrame(CoordSpace.SceneCoords); curChange.parentScaleBefore = GetLocalScale(); if (target.IsTemporary) { curChange.childSOs = new List <TransformableSO>(); SceneUtil.FindAllPersistentTransformableChildren(target, curChange.childSOs); curChange.before = new List <Frame3f>(); curChange.scaleBefore = new List <Vector3f>(); foreach (TransformableSO so in curChange.childSOs) { curChange.before.Add(so.GetLocalFrame(CoordSpace.SceneCoords)); curChange.scaleBefore.Add(UnityUtil.GetFreeLocalScale(so.RootGameObject)); } } }