Package fcagnin.jglsdk.glm

Examples of fcagnin.jglsdk.glm.Vec3


    private void processXChange(int iXDiff, boolean bClearY) {
      float degAngleDiff = iXDiff * m_viewScale.rotationScale;

      // Rotate about the world-space Y axis.
      m_currView.orient = Quaternion.mul(m_startDragOrient, Glm.angleAxis(degAngleDiff, new Vec3(0.0f, 1.0f, 0.0f)));
    }
View Full Code Here


    private void processYChange(int iYDiff, boolean bClearXZ) {
      float degAngleDiff = iYDiff * m_viewScale.rotationScale;

      // Rotate about the local-space X axis.
      m_currView.orient = Glm.angleAxis(degAngleDiff, new Vec3(1.0f, 0.0f, 0.0f)).mul(m_startDragOrient);
    }
View Full Code Here

    private void processXYChange(int iXDiff, int iYDiff) {
      float degXAngleDiff = (iXDiff * m_viewScale.rotationScale);
      float degYAngleDiff = (iYDiff * m_viewScale.rotationScale);

      // Rotate about the world-space Y axis.
      m_currView.orient = Quaternion.mul(m_startDragOrient, Glm.angleAxis(degXAngleDiff, new Vec3(0.0f, 1.0f, 0.0f)));
      // Rotate about the local-space X axis.
      m_currView.orient = Glm.angleAxis(degYAngleDiff, new Vec3(1.0f, 0.0f, 0.0f)).mul(m_currView.orient);
    }
View Full Code Here

      }
    }
   
   
    private void offsetTargetPos(TargetOffsetDir eDir, float worldDistance, float lastFrameDuration) {
      Vec3 offsetDir = new Vec3(g_offsets[eDir.ordinal()]);
      offsetTargetPos(offsetDir.scale(worldDistance).scale(lastFrameDuration), lastFrameDuration);
    }
View Full Code Here

    private void offsetTargetPos(Vec3 cameraOffset, float lastFrameDuration) {
      Mat4 currMat = calcMatrix();
      Quaternion orientation = Glm.quatCast(currMat);

      Quaternion invOrient = Glm.conjugate(orientation);
      Vec3 worldOffset = invOrient.mul(cameraOffset);

      m_currView.targetPos.add(worldOffset);
    }
View Full Code Here

      this.position = position;
      this.orientation = orientation;
    }

    public ObjectData(ObjectData initialData) {
      position = new Vec3(initialData.position);
      orientation = new Quaternion(initialData.orientation);
    }
View Full Code Here

    Quaternion orient;
    public float radius;
    float degSpinRotation;
   
    public ViewData(ViewData viewData) {
      targetPos = new Vec3(viewData.targetPos);
      orient = new Quaternion(viewData.orient);
      radius = viewData.radius;
      degSpinRotation = viewData.degSpinRotation;
    }
View Full Code Here

    }

    private class StationaryOffset extends Instance {
        @Override
        Vec3 calcOffset(float elapsedTime) {
            return new Vec3( 0.0f, 0.0f, -20.0f );
        }
View Full Code Here

            final float loopDuration = 3.0f;
            final float scale = 3.14159f * 2.0f / loopDuration;

            float currTimeThroughLoop = elapsedTime % loopDuration;

            return new Vec3(
                    (float) (Math.cos( currTimeThroughLoop * scale ) * 4.f),
                    (float) (Math.sin( currTimeThroughLoop * scale ) * 6.f),
                    -20.0f
            );
        }
View Full Code Here

            final float loopDuration = 12.0f;
            final float scale = 3.14159f * 2.0f / loopDuration;

            float currTimeThroughLoop = elapsedTime % loopDuration;

            return new Vec3(
                    (float) (Math.cos( currTimeThroughLoop * scale ) * 5.f),
                    -3.5f,
                    (float) (Math.sin( currTimeThroughLoop * scale ) * 5.f - 20.f)
            );
        }
View Full Code Here

TOP

Related Classes of fcagnin.jglsdk.glm.Vec3

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.