/// <summary>
        /// Creates a UI3DView instance that can be used to render 3D elements
        /// (sims) in this scene on top of UI elements.
        /// </summary>
        /// <param name="Width">The width of the rendering surface for this UI3DView instance.</param>
        /// <param name="Height">The height of the rendering surface for this UI3DView instance.</param>
        /// <param name="SingleRenderer">Will this UI3DView be used to render a single or multiple sims?</param>
        /// <param name="StrID">The string ID of this UI3DView instance.</param>
        /// <returns>A UI3DView instance.</returns>
        //public UI3DView Create3DView(int Width, int Height, bool SingleRenderer, string StrID)
        //{
        //    UI3DView ThreeDView = new UI3DView(Width, Height, SingleRenderer, this, StrID);
        //    m_Elements.Add(ThreeDView);

        //    return ThreeDView;
        //}

        public void Add(ThreeDElement item)
        {
            m_Elements.Add(item);
            item.Scene = this;
        }
예제 #2
0
 /// <summary>
 /// Creates a UI3DView instance that can be used to render 3D elements
 /// (sims) in this scene on top of UI elements.
 /// </summary>
 /// <param name="Width">The width of the rendering surface for this UI3DView instance.</param>
 /// <param name="Height">The height of the rendering surface for this UI3DView instance.</param>
 /// <param name="SingleRenderer">Will this UI3DView be used to render a single or multiple sims?</param>
 /// <param name="StrID">The string ID of this UI3DView instance.</param>
 /// <returns>A UI3DView instance.</returns>
 //public UI3DView Create3DView(int Width, int Height, bool SingleRenderer, string StrID)
 //{
 //    UI3DView ThreeDView = new UI3DView(Width, Height, SingleRenderer, this, StrID);
 //    m_Elements.Add(ThreeDView);
 //    return ThreeDView;
 //}
 public void Add(ThreeDElement item)
 {
     m_Elements.Add(item);
     item.Scene = this;
 }
        private void SetSelected(ThreeDElement element)
        {
            if (element == null)
            {
                tabWorld.Enabled = false;
                tabCamera.Enabled = false;
                return;
            }

            SetSelectedScene(element.Scene);

            tabWorld.Enabled = true;
            tabCamera.Enabled = true;

            Selected = null;

            valueX.Value = (decimal)element.Position.X;
            valueY.Value = (decimal)element.Position.Y;
            valueZ.Value = (decimal)element.Position.Z;

            valueScaleX.Value = (decimal)element.Scale.X;
            valueScaleY.Value = (decimal)element.Scale.Y;
            valueScaleZ.Value = (decimal)element.Scale.Z;

            var rotateX = MathUtils.RadianToDegree((double)element.RotationX);
            var rotateY = MathUtils.RadianToDegree((double)element.RotationY);
            var rotateZ = MathUtils.RadianToDegree((double)element.RotationZ);

            valueRotateXBar.Value = (int)rotateX;
            valueRotateX.Value = (decimal)rotateX;

            valueRotateYBar.Value = (int)rotateY;
            valueRotateY.Value = (decimal)rotateY;

            valueRotateZBar.Value = (int)rotateZ;
            valueRotateZ.Value = (decimal)rotateZ;

            Selected = element;

            //valueScaleX.Value = (decimal)element.ScaleX;
            //valueScaleY.Value = (decimal)element.ScaleY;
            //valueAlpha.Value = (decimal)element.Opacity;
        }