Ejemplo n.º 1
0
        public void UpdateControl()
        {
            string s = m_camerManagerWrapper.GetCurrentCamera();

            CLI.ManagedVector3 p = m_camerManagerWrapper.GetCurrentCameraPosition();
            CLI.ManagedVector3 t = m_camerManagerWrapper.GetCurrentCameraTarget();
            if (!cameraPosX.Focused)
            {
                cameraPosX.Text = String.Format("{0:0.00}", p.x);
            }
            if (!cameraPosY.Focused)
            {
                cameraPosY.Text = String.Format("{0:0.00}", p.y);
            }
            if (!cameraPosZ.Focused)
            {
                cameraPosZ.Text = String.Format("{0:0.00}", p.z);
            }
            if (!cameraTarX.Focused)
            {
                cameraTarX.Text = String.Format("{0:0.00}", t.x);
            }
            if (!cameraTarY.Focused)
            {
                cameraTarY.Text = String.Format("{0:0.00}", t.y);
            }
            if (!cameraTarZ.Focused)
            {
                cameraTarZ.Text = String.Format("{0:0.00}", t.z);
            }
        }
Ejemplo n.º 2
0
 private void CameraPosZ_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         float f = float.Parse(cameraPosZ.Text);
         CLI.ManagedVector3 p = m_camerManagerWrapper.GetCurrentCameraPosition();
         p.z = f;
         m_camerManagerWrapper.SetCurrentCameraPosition(p);
     }
 }
Ejemplo n.º 3
0
 public void OnFrameEnd(Object o, EventArgs e)
 {
     // return;
     CLI.ZobObjectWrapper z = m_zobObjectManagerWrapper.GetRootObject();
     if (z != null && z.IsValid())
     {
         CLI.ManagedVector3 v = z.GetRotation();
         v.y += 0.8f;
         z.SetRotation(v);
     }
 }
Ejemplo n.º 4
0
        private void EngineRender_MouseMove(object sender, MouseEventArgs e)
        {
            int dx = m_lastMouseX - e.X;
            int dy = m_lastMouseY - e.Y;

            if (e.Button == MouseButtons.Left)
            {
                if (!m_mainForm.IsCtrlPressed())
                {
                    //MOVE OBJECT HERE
                    if (m_selectedObject != null && m_currentMouseAction.Length != 0)
                    {
                        CLI.ManagedVector3 p = m_selectedObject.GetTransform();
                        switch (m_currentMouseAction)
                        {
                        case "transformY":
                            p.y += dy;
                            break;

                        default:
                            break;
                        }
                        m_selectedObject.SetTransform(p);
                    }
                }
                else
                {
                    m_mainForm.GetCameraControl().GetWrapper().RotateAroundAxis((float)-dx, (float)dy);
                    //m_mainForm.GetCameraControl().GetWrapper().Move((float)-dx*2.0f, (float)-dy*2.0f);
                }
            }
            else if (e.Button == MouseButtons.Middle)
            {
                m_mainForm.GetCameraControl().GetWrapper().Move((float)-dx * 2.0f, (float)-dy * 2.0f);
            }
            else
            {
            }
            m_lastMouseX = e.X;
            m_lastMouseY = e.Y;
        }
Ejemplo n.º 5
0
        private void UpdateValues()
        {
            if (m_zobObjectWrapper != null && m_zobObjectWrapper.IsValid())
            {
                CLI.ManagedVector3 p = m_zobObjectWrapper.GetTransform();
                CLI.ManagedVector3 r = m_zobObjectWrapper.GetRotation();
                CLI.ManagedVector3 s = m_zobObjectWrapper.GetScale();

                float px = p.x;
                float py = p.y;
                float pz = p.z;
                float rx = r.x;
                float ry = r.y;
                float rz = r.z;
                float sx = s.x;
                float sy = s.y;
                float sz = s.z;
                float f;
                if (float.TryParse(zobPosX.Text, out f))
                {
                    p.x = f;
                }
                if (float.TryParse(zobPosY.Text, out f))
                {
                    p.y = f;
                }
                if (float.TryParse(zobPosZ.Text, out f))
                {
                    p.z = f;
                }
                if (float.TryParse(zobRotX.Text, out f))
                {
                    r.x = f;
                }
                if (float.TryParse(zobRotY.Text, out f))
                {
                    r.y = f;
                }
                if (float.TryParse(zobRotZ.Text, out f))
                {
                    r.z = f;
                }
                if (float.TryParse(zobScaleX.Text, out f))
                {
                    s.x = f;
                }
                if (float.TryParse(zobScaleY.Text, out f))
                {
                    s.y = f;
                }
                if (float.TryParse(zobScaleZ.Text, out f))
                {
                    s.z = f;
                }

                m_zobObjectWrapper.SetTransform(p);
                m_zobObjectWrapper.SetRotation(r);
                m_zobObjectWrapper.SetScale(s);
                SetValues();
            }
        }