Example #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);
 }
Example #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)));
 }
Example #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)));
 }