Esempio n. 1
0
 public void lookThrough() {
   position.setX(position.getX() + velocity.getX());
   position.setY(position.getY() + velocity.getY());
   position.setZ(position.getZ() + velocity.getZ());
   GL11.glRotatef(pitch, 1.0f, 0.0f, 0.0f);
   GL11.glRotatef(yaw, 0.0f, 1.0f, 0.0f);
   GL11.glTranslatef(position.x, position.y, position.z);
 }
Esempio n. 2
0
 public void strafeRight(float distance) {
   velocity.setX(distance * -(float) Math.sin(Math.toRadians(yaw + 90)));
   velocity.setZ(distance * (float) Math.cos(Math.toRadians(yaw + 90)));
 }
Esempio n. 3
0
 public void walkBackward(float distance) {
   velocity.setX(distance * (float) Math.sin(Math.toRadians(yaw)));
   velocity.setZ(distance * -(float) Math.cos(Math.toRadians(yaw)));
 }