Package javax.vecmath

Examples of javax.vecmath.Quat4f


             Point3f[] positions,
             float[] scales) {

  this.quats = new Quat4f[quats.length];
  for(int i = 0; i < quats.length; i++) {
      this.quats[i] = new Quat4f();
      this.quats[i].set(quats[i]);
  }

  this.positions = new Point3f[positions.length];
  for(int i = 0; i < positions.length; i++) {
View Full Code Here


        positions = new Point3f[len];
        quats = new Quat4f[len];
        scales = new float[len];

        Point3f point = new Point3f();
        Quat4f quat = new Quat4f();

        for (int i = 0; i < len; i++) {
            positions[i] = new Point3f();
            ri.getPosition(i, point);
            setPosition(i, point);

            quats[i] = new Quat4f();
            ri.getQuat(i, quat);
            setQuat(i, quat);

            setScale(i, ri.getScale(i));
        }
View Full Code Here

      EvolvableBoxAgent3D agent) {
   
    Transform worldTransform = new Transform();   
    agent.getAgentCore().getRigidBody().getMotionState().getWorldTransform(worldTransform)
   
    Quat4f rot = new Quat4f();   
   
    worldTransform.getRotation(rot);
   
    //Vector3f v = new Vector3f(1,1,1);
    Vector3f v = new Vector3f(1,0,0);
View Full Code Here

   
   
    // yaw: links rechts bzw. HochAchse
    // pitch: hoch runter bzw. QuerAchse
    // roll: nach links/rechts kippen bzw. LängsAchse
    Quat4f rotQuat = new Quat4f();
    QuaternionUtil.setEuler(
        rotQuat,
        (float) Math.toRadians(this.startRotation.x),
        (float) Math.toRadians(this.startRotation.y),
        (float) Math.toRadians(this.startRotation.z)
View Full Code Here

    gl.glLoadIdentity();

    float rele = (float) Math.toRadians(ele);
    float razi = (float) Math.toRadians(azi);

    Quat4f rot = new Quat4f();
    // Quaternion für 2. Achse (y, also nach oben) berechnen
    // bei Drehung um "razi" im Bogenmaß. Entspricht Drehung
    // nach links und rechts.
    QuaternionUtil.setRotation(rot, cameraUp, razi);

    Vector3f eyePos = new Vector3f();
    eyePos.set(0f, 0f, 0f);

    // 3. Koordinate setzen für den Abstand. 3. Achse bzw. z ist nach vorne.
    VectorUtil.setCoord(eyePos, forwardAxis, -cameraDistance);

    Vector3f forward = new Vector3f();
    forward.set(eyePos.x, eyePos.y, eyePos.z);

    if (forward.lengthSquared() < BulletGlobals.FLT_EPSILON) {
      forward.set(1f, 0f, 0f);
    }

    Vector3f right = new Vector3f();
    right.cross(cameraUp, forward);
    Quat4f roll = new Quat4f();
    QuaternionUtil.setRotation(roll, right, -rele);

    Matrix3f tmpMat1 = new Matrix3f();
    Matrix3f tmpMat2 = new Matrix3f();
    tmpMat1.set(rot);
View Full Code Here

    private Interpolator createGravityInterpolator(TransformGroup newTransformGroup) {
        Vector3f translationVector = new Vector3f();
        Transform3D transform = new Transform3D();
        newTransformGroup.getTransform(transform);
        transform.get(translationVector);
        Quat4f rotationQuat = new Quat4f();
        transform.get(rotationQuat);
        float[] knots = new float[] { 0, 1 };
        Point3f position1 = new Point3f(translationVector.getX(), translationVector.getY(), translationVector.getZ());
        Point3f position2 = ProjectionHelper.getProjectionPoint(position1);
        Point3f[] positions = new Point3f[] { position1, position2 };
View Full Code Here

    // Set the specific arrays for this path interpolator
    private void setPathArrays(Quat4f[] quats) {
  this.quats = new Quat4f[quats.length];
  for(int i = 0; i < quats.length; i++) {
      this.quats[i] = new Quat4f();
      this.quats[i].set(quats[i]);
  }
    }
View Full Code Here

  int len = ri.getArrayLengths();

  // No API available to change size of array, so set here explicitly
        quats = new Quat4f[len];
        Quat4f quat = new Quat4f();

        for (int i = 0; i < len; i++) {
           quats[i] = new Quat4f();
           ri.getQuat(i, quat);
           setQuat(i, quat);
        }

    }
View Full Code Here

          b[1].cross(ab, b[1]);
          b[2].cross(ab, b[2]);

          float m[] = new float[] { b[0].lengthSquared(), b[1].lengthSquared(), b[2].lengthSquared() };

          Quat4f tmpQuat = Stack.alloc(Quat4f.class);
          tmp.normalize(ab);
          QuaternionUtil.setRotation(tmpQuat, tmp, cst2Pi / 3f);

          Matrix3f r = Stack.alloc(Matrix3f.class);
          MatrixUtil.setRotation(r, tmpQuat);
View Full Code Here

      CollisionShape cylinderShape = new CylinderShapeX(new Vector3f(4, 1, 1));
      CollisionShape boxShape = new BoxShape(new Vector3f(4f, 1f, 1f));
      Transform localTransform = new Transform();
      localTransform.setIdentity();
      ((CompoundShape)colShape).addChildShape(localTransform, boxShape);
      Quat4f orn = new Quat4f();
      QuaternionUtil.setEuler(orn, BulletGlobals.SIMD_HALF_PI, 0f, 0f);
      localTransform.setRotation(orn);
      ((CompoundShape)colShape).addChildShape(localTransform, cylinderShape);
    }
View Full Code Here

TOP

Related Classes of javax.vecmath.Quat4f

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.