Пример #1
0
        virtual public bool EndCapture(InputEvent e)
        {
            if (activeWidget != null)
            {
                activeWidget.EndCapture(targetWrapper);
                MaterialUtil.SetMaterial(activeWidget.RootGameObject, activeWidget.StandardMaterial);

                // tell wrapper we are done with capture, so it should bake transform/etc
                bool bModified = targetWrapper.DoneTransformation(EmitChanges);
                if (bModified)
                {
                    // update gizmo
                    onTransformModified(null);
                    // allow client/subclass to add any other change records
                    OnTransformInteractionEnd();
                    // gizmos drop change events by default
                    if (EmitChanges)
                    {
                        Scene.History.PushInteractionCheckpoint();
                    }
                }

                activeWidget = null;
            }
            return(true);
        }
Пример #2
0
        public bool EndCapture(Ray ray)
        {
            if (activeWidget != null)
            {
                // update widget frame in case we want to do something like stay scene-aligned...
                targetWrapper.DoneTransformation();
                Frame3 widgetFrame = targetWrapper.GetLocalFrame(CoordSpace.ObjectCoords);
                gizmo.transform.localPosition = widgetFrame.Origin;
                gizmo.transform.localRotation = widgetFrame.Rotation;

                activeWidget = null;
            }
            return(true);
        }
Пример #3
0
        virtual public bool EndCapture(InputEvent e)
        {
            if (activeWidget != null)
            {
                MaterialUtil.SetMaterial(activeWidget.RootGameObject, activeWidget.StandardMaterial);

                // update widget frame in case we want to do something like stay scene-aligned...
                activeWidget.EndCapture(targetWrapper);

                // note: e will be null if we call this from Disconnect(), because we were in an
                //   active capture when we were Disconnected. Not sure how to handle this gracefully
                //   in subclasses...could pass e directly to OnEndCapture? pass a flag?
                if (e != null)
                {
                    OnEndCapture(e.ray, activeWidget);
                }

                // tell wrapper we are done with capture, so it should bake transform/etc
                bool bModified = targetWrapper.DoneTransformation(EmitChanges);
                if (bModified)
                {
                    // update gizmo
                    onTransformModified(null);
                    // allow client/subclass to add any other change records
                    OnTransformInteractionEnd();
                    // gizmos drop change events by default
                    if (EmitChanges)
                    {
                        Scene.History.PushInteractionCheckpoint();
                    }
                }
            }

            activeWidget = null;
            return(true);
        }