Hook user settings into draw/sim radius

This commit is contained in:
austin 2021-08-07 18:00:19 -04:00
parent 0ef9d8c309
commit e39af4a78c
4 changed files with 22 additions and 1 deletions

View File

@ -1,11 +1,14 @@
{
"gameplayGenerateWorld" : false,
"gameplayPhysicsCellRadius" : 2,
"displayWidth" : 1920,
"displayHeight" : 1080,
"graphicsFOV" : 90.0,
"graphicsPerformanceLODChunkRadius" : 5,
"graphicsPerformanceEnableVSync" : true,
"graphicsPerformanceDrawShadows" : true,

View File

@ -95,6 +95,10 @@ public class DrawCellManager {
program = Globals.defaultMeshShader;
drawRadius = Globals.userSettings.getGraphicsPerformanceLODChunkRadius();
drawStepdownInterval = Globals.userSettings.getGameplayPhysicsCellRadius();
physicsRadius = Globals.userSettings.getGameplayPhysicsCellRadius();
update = true;
}

View File

@ -14,6 +14,7 @@ public class UserSettings {
//Gameplay settings
//
boolean gameplayGenerateWorld;
int gameplayPhysicsCellRadius;
//
@ -29,6 +30,7 @@ public class UserSettings {
//general
float graphicsFOV;
//performance
int graphicsPerformanceLODChunkRadius;
boolean graphicsPerformanceEnableVSync;
boolean graphicsPerformanceDrawShadows;
//debug
@ -78,6 +80,14 @@ public class UserSettings {
public boolean graphicsDebugDrawMovementVectors() {
return graphicsDebugDrawMovementVectors;
}
public int getGameplayPhysicsCellRadius() {
return gameplayPhysicsCellRadius;
}
public int getGraphicsPerformanceLODChunkRadius() {
return graphicsPerformanceLODChunkRadius;
}
@ -100,11 +110,13 @@ public class UserSettings {
//gameplay settings
rVal.gameplayGenerateWorld = true;
rVal.gameplayPhysicsCellRadius = 2;
//graphics settings
rVal.graphicsDebugDrawCollisionSpheres = false;
rVal.graphicsDebugDrawMovementVectors = false;
rVal.graphicsDebugDrawPhysicsObjects = false;
rVal.graphicsPerformanceLODChunkRadius = 5;
rVal.graphicsFOV = 90.0f;
rVal.graphicsPerformanceDrawShadows = true;
rVal.graphicsPerformanceEnableVSync = true;

View File

@ -1,6 +1,7 @@
package electrosphere.net.server;
import electrosphere.entity.Entity;
import electrosphere.main.Globals;
import electrosphere.net.parser.net.message.NetworkMessage;
import java.util.concurrent.Semaphore;
@ -25,6 +26,7 @@ public class Player {
id = idIncrementer;
idIncrementer++;
idIncrementerLock.release();
this.simulationRadius = Globals.userSettings.getGameplayPhysicsCellRadius();
}
public int getId() {