viewport camera lockdown
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
This commit is contained in:
parent
f78c8b6633
commit
d2a8acf027
@ -41,6 +41,9 @@ public class CameraHandler {
|
||||
//if set to true, the camera will track the player's entity
|
||||
boolean trackPlayerEntity = true;
|
||||
|
||||
//sets whether the camera handler should update the player's camera or not
|
||||
boolean update = true;
|
||||
|
||||
/**
|
||||
* Handles a mouse event
|
||||
* @param event The mouse event
|
||||
@ -75,6 +78,7 @@ public class CameraHandler {
|
||||
*/
|
||||
public void updateGlobalCamera(){
|
||||
Globals.profiler.beginCpuSample("updateGlobalCamera");
|
||||
if(update){
|
||||
if(Globals.playerCamera != null){
|
||||
cameraSpeed = 2.5f * (float)Globals.timekeeper.getMostRecentRawFrametime();
|
||||
|
||||
@ -158,6 +162,7 @@ public class CameraHandler {
|
||||
//update the cursor on client side
|
||||
updatePlayerCursor();
|
||||
}
|
||||
}
|
||||
Globals.profiler.endCpuSample();
|
||||
}
|
||||
|
||||
@ -209,6 +214,14 @@ public class CameraHandler {
|
||||
return trackPlayerEntity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether the camera should update with player input or not
|
||||
* @param update true to update with input, false otherwise
|
||||
*/
|
||||
public void setUpdate(boolean update){
|
||||
this.update = update;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -112,6 +112,7 @@ public class ClientLoading {
|
||||
//init camera
|
||||
Globals.playerCamera = CameraEntityUtils.spawnBasicCameraEntity(new Vector3f(0,0,0), new Vector3f(-1,0,0));
|
||||
Globals.cameraHandler.setTrackPlayerEntity(false);
|
||||
Globals.cameraHandler.setUpdate(false);
|
||||
//initialize the "real" objects simulation
|
||||
initClientSimulation();
|
||||
//init foliage manager
|
||||
|
||||
Loading…
Reference in New Issue
Block a user