Package javax.vecmath

Examples of javax.vecmath.AxisAngle4f


/* 102 */     Vector3f[] capNormals = new Vector3f[divisions];
/* 103 */     Vector3f cap0Normal = new Vector3f(axis1);
/* 104 */     Vector3f cap1Normal = new Vector3f(axis1);
/* 105 */     cap0Normal.negate();
/*     */
/* 107 */     AxisAngle4f aa4f = new AxisAngle4f(axis1, -3.141593F / (divisions / 2.0F));
/*     */
/* 109 */     Transform3D t3d = new Transform3D();
/* 110 */     t3d.set(aa4f);
/*     */
/* 112 */     float halfWidth = (float)baseWidth / 2.0F;
View Full Code Here


  private Matrix4f transformM = new Matrix4f();
  public void rotate(float angle) {
    endPrimitivesKeepImage();
    transformM.setIdentity();
    transformM.setRotation(new AxisAngle4f(new Vector3f(0f,0f,1f), angle * DEG_TO_RAD_FACTOR));
    modelTransform.mul(transformM);
    applyTransform(viewTransform, modelTransform);
  }
View Full Code Here

//    gl.glRotatef(angle, 0, 0, 1);
//
//    // Translate to camera
//    gl.glTranslatef(translationX, translationY, 0);
    viewTransform.setIdentity();
    viewTransform.setRotation(new AxisAngle4f(new Vector3f(1,0,0), (float)Math.PI));
    m1.setIdentity();
    m1.setRotation(new AxisAngle4f(new Vector3f(0,0,1), angle * DEG_TO_RAD_FACTOR));
    viewTransform.mul(m1);
    m2.setIdentity();
    m2.setTranslation(new Vector3f(translationX, translationY, 0));
    viewTransform.mul(m2);
   
View Full Code Here

//      transforms.get(i).apply(gl);
//    }
//    gl.glScalef(1, -1, 1);

    textTransform.setIdentity();
    textTransform.setRotation(new AxisAngle4f(new Vector3f(1,0,0), (float)Math.PI));
    m1.setIdentity();
    m1.setTranslation(new Vector3f(translationX, translationY, 0));
    textTransform.mul(m1);
    textTransform.mul(modelTransform);
    scaleMatrix(m2, 1, -1, 1);
View Full Code Here

  private Matrix4f transformM = new Matrix4f();
  public void rotate(float angle) {
    endPrimitivesKeepImage();
    transformM.setIdentity();
    transformM.setRotation(new AxisAngle4f(new Vector3f(0f,0f,1f), angle * DEG_TO_RAD_FACTOR));
    modelTransform.mul(transformM);
    applyTransform(viewTransform, modelTransform);
  }
View Full Code Here

//    gl.glRotatef(angle, 0, 0, 1);
//
//    // Translate to camera
//    gl.glTranslatef(translationX, translationY, 0);
    viewTransform.setIdentity();
    viewTransform.setRotation(new AxisAngle4f(new Vector3f(1,0,0), (float)Math.PI));
    m1.setIdentity();
    m1.setRotation(new AxisAngle4f(new Vector3f(0,0,1), angle * DEG_TO_RAD_FACTOR));
    viewTransform.mul(m1);
    m2.setIdentity();
    m2.setTranslation(new Vector3f(translationX, translationY, 0));
    viewTransform.mul(m2);
   
View Full Code Here

//      transforms.get(i).apply(gl);
//    }
//    gl.glScalef(1, -1, 1);
   
    textTransform.setIdentity();
    textTransform.setRotation(new AxisAngle4f(new Vector3f(1,0,0), (float)Math.PI));
    m1.setIdentity();
    m1.setTranslation(new Vector3f(translationX, translationY, 0));
    textTransform.mul(m1);
    textTransform.mul(modelTransform);
    scaleMatrix(m2, 1, -1, 1);
View Full Code Here

                targetDirection.sub(ai.movementTarget, worldPos);
                targetDirection.normalize();
                drive.set(targetDirection);

                float yaw = (float) Math.atan2(targetDirection.x, targetDirection.z);
                AxisAngle4f axisAngle = new AxisAngle4f(0, 1, 0, yaw);
                location.getLocalRotation().set(axisAngle);
                entity.saveComponent(location);
            }
            entity.send(new CharacterMoveInputEvent(0, 0, 0, drive, false, false));
        }
View Full Code Here

    @SuppressWarnings(value = "SuspiciousNameCombination")
    private void updateRotation(CharacterMovementComponent movementComp, CharacterStateEvent result,
                                CharacterMoveInputEvent input) {
        if (movementComp.faceMovementDirection && result.getVelocity().lengthSquared() > 0.01f) {
            float yaw = (float) Math.atan2(result.getVelocity().x, result.getVelocity().z);
            AxisAngle4f axisAngle = new AxisAngle4f(0, 1, 0, yaw);
            result.getRotation().set(axisAngle);
        } else {
            QuaternionUtil.setEuler(result.getRotation(), TeraMath.DEG_TO_RAD * input.getYaw(), 0, 0);
        }
    }
View Full Code Here

    public void generate(CoreChunk view, Random rand, int posX, int posY, int posZ) {
        Vector3f position = new Vector3f(0f, 0f, 0f);

        Matrix4f rotation = new Matrix4f();
        rotation.setIdentity();
        rotation.setRotation(new AxisAngle4f(0f, 0f, 1f, (float) Math.PI / 2f));

        float angleOffset = rand.nextFloat(-MAX_ANGLE_OFFSET, MAX_ANGLE_OFFSET);
        recurse(view, rand, posX, posY, posZ, angleOffset, new CharSequenceIterator(initialAxiom), position, rotation, 0);
    }
View Full Code Here

TOP

Related Classes of javax.vecmath.AxisAngle4f

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.