Package fcagnin.jglsdk.glm

Examples of fcagnin.jglsdk.glm.Vec2


      m_bIsDragging = true;
    }

   
    private void onDragRotate(Vec2 ptCurr) {
      Vec2 iDiff = Vec2.sub(ptCurr, m_startDragMouseLoc);
      int iXDiff = (int) iDiff.x;
      int iYDiff = (int) - iDiff.y;                      // Y axis is different in LWJGL
     
      switch (m_RotateMode) {
        case RM_DUAL_AXIS_ROTATE:
View Full Code Here


     * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

    @Override
    public void mouseMove(Vec2 position) {
      if (m_bIsDragging) {
        Vec2 iDiff = Vec2.sub(position, m_prevMousePos);
   
        switch (m_RotateMode) {
          case RM_DUAL_AXIS: {
            Quaternion rot = calcRotationQuat(Axis.AXIS_Y.ordinal(), iDiff.x * m_rotateScale);
            rot = Glm.normalize(calcRotationQuat(Axis.AXIS_X.ordinal(), - iDiff.y * m_rotateScale).mul(rot))// Y axis is different in LWJGL
            rotateViewDegrees(rot);
            break;
         
         
          case RM_BIAXIAL: {
            Vec2 iInitDiff = Vec2.sub(position, m_startDragMousePos);
   
            Axis eAxis;
            float degAngle;
            if (Math.abs(iInitDiff.x) > Math.abs(iInitDiff.y)) {
              eAxis = Axis.AXIS_Y;
View Full Code Here

* @author integeruser
*/
public class MousePole {

    public static void forwardMouseMotion(Pole forward, int x, int y) {
        forward.mouseMove( new Vec2( x, y ) );
    }
View Full Code Here

    }


    public static void forwardMouseButton(Pole forwardPole, int button, boolean state, int x, int y) {
        MouseModifiers modifiers = calcModifiers();
        Vec2 mouseLoc = new Vec2( x, y );
        MouseButtons mouseButtons = null;

        switch ( button ) {
            case 0:
                mouseButtons = MouseButtons.MB_LEFT_BTN;
View Full Code Here

        forwardPole.mouseClick( mouseButtons, state, modifiers, mouseLoc );
    }


    public static void forwardMouseWheel(Pole forward, int wheel, int direction, int x, int y) {
        forward.mouseWheel( direction, calcModifiers(), new Vec2( x, y ) );
    }
View Full Code Here

TOP

Related Classes of fcagnin.jglsdk.glm.Vec2

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.