Class Arcball1DOFAdapter

  • All Implemented Interfaces:
    java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.util.EventListener, javax.swing.event.MouseInputListener

    public class Arcball1DOFAdapter
    extends javax.swing.event.MouseInputAdapter
    Arcball style helper.
    Since:
    0.6.0
    Author:
    Erich Schubert
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Simple1DOFCamera camera
      The true camera.
      private static boolean DEBUG
      Debug flag.
      private double[] endvec
      Ending point of drag.
      private double[] far
      Temp buffer we use for computations.
      private double[] near
      Temp buffer we use for computations.
      (package private) double startangle
      Starting angle for dragging.
      private Simple1DOFCamera startcamera
      Camera that was in use when the drag started.
      private double[] startvec
      Starting point of drag.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void debugRender​(javax.media.opengl.GL2 gl)
      Render a debugging hint for the arcball tool.
      private void mapMouseToPlane​(Simple1DOFCamera camera, java.awt.Point point2d, double[] vec)
      Map the coordinates.
      void mouseDragged​(java.awt.event.MouseEvent e)  
      void mousePressed​(java.awt.event.MouseEvent e)  
      void mouseWheelMoved​(java.awt.event.MouseWheelEvent e)  
      • Methods inherited from class java.awt.event.MouseAdapter

        mouseClicked, mouseEntered, mouseExited, mouseMoved, mouseReleased
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.awt.event.MouseListener

        mouseClicked, mouseEntered, mouseExited, mouseReleased
      • Methods inherited from interface java.awt.event.MouseMotionListener

        mouseMoved
    • Field Detail

      • startvec

        private double[] startvec
        Starting point of drag.
      • endvec

        private double[] endvec
        Ending point of drag.
      • near

        private double[] near
        Temp buffer we use for computations.
      • far

        private double[] far
        Temp buffer we use for computations.
      • startangle

        double startangle
        Starting angle for dragging.
      • startcamera

        private Simple1DOFCamera startcamera
        Camera that was in use when the drag started.
    • Constructor Detail

      • Arcball1DOFAdapter

        public Arcball1DOFAdapter​(Simple1DOFCamera camera)
        Constructor.
        Parameters:
        camera - Scene camera
    • Method Detail

      • mouseWheelMoved

        public void mouseWheelMoved​(java.awt.event.MouseWheelEvent e)
        Specified by:
        mouseWheelMoved in interface java.awt.event.MouseWheelListener
        Overrides:
        mouseWheelMoved in class java.awt.event.MouseAdapter
      • mousePressed

        public void mousePressed​(java.awt.event.MouseEvent e)
        Specified by:
        mousePressed in interface java.awt.event.MouseListener
        Overrides:
        mousePressed in class java.awt.event.MouseAdapter
      • mapMouseToPlane

        private void mapMouseToPlane​(Simple1DOFCamera camera,
                                     java.awt.Point point2d,
                                     double[] vec)
        Map the coordinates. Note: vec will be overwritten!
        Parameters:
        camera - Camera
        point2d - Input point
        vec - Output vector
      • mouseDragged

        public void mouseDragged​(java.awt.event.MouseEvent e)
        Specified by:
        mouseDragged in interface java.awt.event.MouseMotionListener
        Overrides:
        mouseDragged in class java.awt.event.MouseAdapter
      • debugRender

        public void debugRender​(javax.media.opengl.GL2 gl)
        Render a debugging hint for the arcball tool.
        Parameters:
        gl - GL class for rendering-