Beispiel #1
0
        private void UpdateScale(Vector3Control control, float x, float y, float z)
        {
            if (_transform == null)
            {
                return;
            }

            _transform.SetLocalScale(x, y, z);
        }
Beispiel #2
0
        private Vector3Control AddControl(Properties parent, string label, Action <Vector3Control, float, float, float> callback)
        {
            var control = new Vector3Control(parent);

            control.Vector3Changed += callback;
            control.UserData        = label;
            parent.Add(label, control);
            return(control);
        }
Beispiel #3
0
        private void UpdateTranslation(Vector3Control control, float x, float y, float z)
        {
            if (_transform == null)
            {
                return;
            }

            _transform.SetLocalPosition(x, y, z);
        }
Beispiel #4
0
        public TransformControl(ControlBase parent = null)
            : base(parent)
        {
            var tree = new PropertyTree(this);

            tree.Dock              = Dock.Top;
            tree.Width             = 300;
            tree.AutoSizeToContent = true;

            var transform = tree.Add("Transform");

            _position = AddControl(transform, "Translation", UpdateTranslation);
            _rotation = AddControl(transform, "Rotation", UpdateRotation);
            _scale    = AddControl(transform, "Scale", UpdateScale);
        }