Ejemplo n.º 1
0
        /// <summary>
        /// Call this function in derived classes to do the OpenGL Draw event.
        /// </summary>
        private void DoOpenGLDraw(PaintEventArgs e)
        {
            GLEventHandler <PaintEventArgs> handler = this.OpenGLDraw;

            if (handler != null)
            {
                handler(this, e);
            }
        }
        void WinGLCanvas_KeyPress(object sender, KeyPressEventArgs e)
        {
            GLEventHandler <GLKeyPressEventArgs> KeyPress = this.glKeyPress;

            if (KeyPress != null)
            {
                GLKeyPressEventArgs arg = e.Translate();
                KeyPress(sender, arg);
            }
        }
        void WinGLCanvas_MouseUp(object sender, MouseEventArgs e)
        {
            GLEventHandler <GLMouseEventArgs> MouseUp = this.glMouseUp;

            if (MouseUp != null)
            {
                GLMouseEventArgs arg = e.Translate();
                MouseUp(sender, arg);
            }
        }
        void WinSoftGLCanvas_MouseMove(object sender, MouseEventArgs e)
        {
            GLEventHandler <GLMouseEventArgs> MouseMove = this.glMouseMove;

            if (MouseMove != null)
            {
                GLMouseEventArgs arg = e.Translate();
                MouseMove(sender, arg);
            }
        }
        void WinGLCanvas_KeyUp(object sender, KeyEventArgs e)
        {
            GLEventHandler <GLKeyEventArgs> keyUp = this.glKeyUp;

            if (keyUp != null)
            {
                GLKeyEventArgs arg = e.Translate();
                keyUp(sender, arg);
            }
        }
        void WinSoftGLCanvas_KeyDown(object sender, KeyEventArgs e)
        {
            GLEventHandler <GLKeyEventArgs> keyDown = this.glKeyDown;

            if (keyDown != null)
            {
                GLKeyEventArgs arg = e.Translate();
                keyDown(sender, arg);
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Rotate model using arc-ball method.
        /// </summary>
        /// <param name="bindingMouseButtons"></param>
        public ArcBallManipulater(GLMouseButtons bindingMouseButtons = GLMouseButtons.Left)
        {
            this.MouseSensitivity    = 6.0f;
            this.BindingMouseButtons = bindingMouseButtons;

            this.mouseDownEvent  = (((IMouseHandler)this).canvas_MouseDown);
            this.mouseMoveEvent  = (((IMouseHandler)this).canvas_MouseMove);
            this.mouseUpEvent    = (((IMouseHandler)this).canvas_MouseUp);
            this.mouseWheelEvent = (((IMouseHandler)this).canvas_MouseWheel);
        }
Ejemplo n.º 8
0
 /// <summary>
 ///
 /// </summary>
 public SatelliteManipulater(GLMouseButtons bindingMouseButtons = GLMouseButtons.Right)
 {
     this.HorizontalRotationFactor = 4;
     this.VerticalRotationFactor   = 4;
     this.BindingMouseButtons      = bindingMouseButtons;
     this.mouseDownEvent           = (((IMouseHandler)this).canvas_MouseDown);
     this.mouseMoveEvent           = (((IMouseHandler)this).canvas_MouseMove);
     this.mouseUpEvent             = (((IMouseHandler)this).canvas_MouseUp);
     this.mouseWheelEvent          = (((IMouseHandler)this).canvas_MouseWheel);
 }
Ejemplo n.º 9
0
        /// <summary>
        /// Rotate model using arc-ball method.
        /// </summary>
        /// <param name="renderer"></param>
        /// <param name="bindingMouseButtons"></param>
        public TranslateManipulater(SceneNodeBase renderer, GLMouseButtons bindingMouseButtons = GLMouseButtons.Left)
        {
            this.renderer            = renderer;
            this.MouseSensitivity    = 6.0f;
            this.BindingMouseButtons = bindingMouseButtons;

            this.mouseDownEvent  = (((IMouseHandler)this).canvas_MouseDown);
            this.mouseMoveEvent  = (((IMouseHandler)this).canvas_MouseMove);
            this.mouseUpEvent    = (((IMouseHandler)this).canvas_MouseUp);
            this.mouseWheelEvent = (((IMouseHandler)this).canvas_MouseWheel);
        }
Ejemplo n.º 10
0
        /// <summary>
        ///
        /// </summary>
        public RotationManipulater(SceneNodeBase rootNode, GLMouseButtons bindingMouseButtons = GLMouseButtons.Left)
        {
            this.rootNode = rootNode;

            this.HorizontalRotationFactor = 4;
            this.VerticalRotationFactor   = 4;
            this.BindingMouseButtons      = bindingMouseButtons;
            this.mouseDownEvent           = (((IMouseHandler)this).canvas_MouseDown);
            this.mouseMoveEvent           = (((IMouseHandler)this).canvas_MouseMove);
            this.mouseUpEvent             = (((IMouseHandler)this).canvas_MouseUp);
            this.mouseWheelEvent          = (((IMouseHandler)this).canvas_MouseWheel);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="stepLength"></param>
        /// <param name="horizontalRotationSpeed"></param>
        /// <param name="verticalRotationSpeed"></param>
        /// <param name="bindingMouseButtons"></param>
        public FirstPerspectiveManipulater(
            float stepLength, float horizontalRotationSpeed,
            float verticalRotationSpeed, GLMouseButtons bindingMouseButtons)
        {
            this.FrontKey = 'w';
            this.BackKey  = 's';
            this.LeftKey  = 'a';
            this.RightKey = 'd';
            this.UpKey    = 'q';
            this.DownKey  = 'e';

            this.StepLength = stepLength;
            this.HorizontalRotationSpeed = horizontalRotationSpeed;
            this.VerticalRotationSpeed   = verticalRotationSpeed;
            this.BindingMouseButtons     = bindingMouseButtons;

            this.keyPressEvent   = (((IKeyboardHandler)this).canvas_KeyPress);
            this.mouseDownEvent  = (((IMouseHandler)this).canvas_MouseDown);
            this.mouseMoveEvent  = (((IMouseHandler)this).canvas_MouseMove);
            this.mouseUpEvent    = (((IMouseHandler)this).canvas_MouseUp);
            this.mouseWheelEvent = (((IMouseHandler)this).canvas_MouseWheel);
        }