pull/12/head
valoeghese 2020-02-26 20:45:11 +13:00
commit 7af779ff49
3 changed files with 6 additions and 3 deletions

1
.gitignore vendored
View File

@ -22,6 +22,7 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
.classpath
.metadata
bin/
tmp/

View File

@ -122,8 +122,8 @@ public class Ginger
public void update(GameData data)
{
data.camera.move();
Window.update();
data.camera.move();
GingerUtils.update();
picker.update();
ParticleMaster.update(data.camera);

View File

@ -1,6 +1,7 @@
package com.github.hydos.ginger.engine.cameras;
import com.github.hydos.ginger.engine.elements.objects.Player;
import com.github.hydos.ginger.engine.io.Window;
import com.github.hydos.ginger.engine.math.vectors.Vector3f;
public class FirstPersonCamera extends Camera
@ -29,12 +30,13 @@ public class FirstPersonCamera extends Camera
public void move()
{
position.x = player.getPosition().x;
position.z = player.getPosition().z;
position.y = player.getPosition().y;
roll = player.getRotX();
yaw = -player.getRotY() + 180;
pitch = player.getRotZ();
yaw = -player.getRotY() + 180 + Window.getNormalizedMouseCoordinates().getX() * 70;
pitch = player.getRotZ() + -Window.getNormalizedMouseCoordinates().getY() * 70;
}
}