Beispiel #1
0
 public Mirror ToMirror()
 {
     return(new Mirror
     {
         Transform = TrTransform.FromLocalTransform(transform),
     });
 }
Beispiel #2
0
        public TrTransform GetSaveTransform()
        {
            var xf = TrTransform.FromLocalTransform(transform);

            xf.scale = GetSignedWidgetSize();
            return(xf);
        }
        public void TestRelativeAccessor_ParentGet()
        {
            var root     = RandomTransform();
            var child    = RandomTransform(root, 2);
            var AsParent = new TransformExtensions.RelativeAccessor(child.parent);

            // If the more precise implementation is used, Assert.AreEqual works
            VeryLooseEqual(TrTransform.FromLocalTransform(child), AsParent[child]);
            UnityEngine.Object.DestroyImmediate(root.gameObject);
        }
        public void TestRelativeAccessor_AncestorGet()
        {
            var root       = RandomTransform();
            var child      = RandomTransform(root, 2);
            var AsAncestor = new TransformExtensions.RelativeAccessor(child.parent.parent);

            VeryLooseEqual(TrTransform.FromLocalTransform(child.parent) *
                           TrTransform.FromLocalTransform(child),
                           AsAncestor[child]);
            UnityEngine.Object.DestroyImmediate(root.gameObject);
        }
        public void TestLocalAccessor()
        {
            var AsLocal = new TransformExtensions.LocalAccessor();

            var root    = RandomTransform();
            var child   = RandomTransform(root, 2);
            var xfLocal = RandomTr();

            AsLocal[child] = xfLocal;
            AssertAlmostEqual(xfLocal, TrTransform.FromLocalTransform(child));
            AssertAlmostEqual(xfLocal, AsLocal[child]);

            UnityEngine.Object.DestroyImmediate(root.gameObject);
        }
 public HideWidgetCommand(GrabWidget widget, BaseCommand parent = null)
     : base(parent)
 {
     m_Widget = widget;
     if (widget is StencilWidget)
     {
         m_WidgetTransform = TrTransform.FromLocalTransform(widget.transform);
     }
     else if (widget is MediaWidget)
     {
         m_WidgetTransform       = TrTransform.FromLocalTransform(widget.transform);
         m_WidgetTransform.scale = widget.GetSignedWidgetSize();
     }
     m_TiltMeterCost = m_Widget.GetTiltMeterCost();
     TiltMeterScript.m_Instance.AdjustMeterWithWidget(m_TiltMeterCost, up: false);
 }
        public MovePositionKnotCommand(CameraPath path, KnotDescriptor knotDesc,
                                       TrTransform endXf_GS, bool final = false, BaseCommand parent = null)
            : base((CameraPathPositionKnot)knotDesc.knot, false, parent)
        {
            m_Path                  = path;
            m_EndXf_CS              = App.Scene.Pose.inverse * endXf_GS;
            m_KnotIndex             = knotDesc.positionKnotIndex.Value;
            m_StartTangentMagnitude = Knot.TangentMagnitude;
            m_Final                 = final;

            if (Knot == null)
            {
                throw new ArgumentException("MovePositionKnotCommand requires CameraPathPositionKnot");
            }
            m_StartXf_CS = TrTransform.FromLocalTransform(Knot.transform);
        }
 public TrTransform this[Transform t] {
     get { return(TrTransform.FromLocalTransform(t)); }
     set { value.ToLocalTransform(t); }
 }