88 lines
2.0 KiB
Java
88 lines
2.0 KiB
Java
package electrosphere.client.scene;
|
|
|
|
import electrosphere.game.server.world.*;
|
|
import electrosphere.server.datacell.ServerDataCell;
|
|
import electrosphere.server.terrain.manager.ServerTerrainManager;
|
|
|
|
import java.util.List;
|
|
import org.joml.Vector2f;
|
|
import org.joml.Vector3f;
|
|
|
|
/**
|
|
*
|
|
* @author amaterasu
|
|
*/
|
|
public class ClientWorldData {
|
|
|
|
|
|
|
|
/*
|
|
|
|
world max
|
|
+---------------------+
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
| |
|
|
+---------------------+
|
|
world min
|
|
|
|
|
|
basically we're saying what the maximum and minimum x and z something can occupy are
|
|
|
|
FOR THE TIME BEING DOES NOT ACCOUNT FOR Y
|
|
*/
|
|
Vector3f worldMinPoint;
|
|
Vector3f worldMaxPoint;
|
|
|
|
int dynamicInterpolationRatio;
|
|
|
|
float randomDampener;
|
|
|
|
|
|
int worldDiscreteSize;
|
|
|
|
|
|
public ClientWorldData(Vector3f worldMinPoint, Vector3f worldMaxPoint, int dynamicInterpolationRatio, float randomDampener, int worldDiscreteSize) {
|
|
this.worldMinPoint = worldMinPoint;
|
|
this.worldMaxPoint = worldMaxPoint;
|
|
this.dynamicInterpolationRatio = dynamicInterpolationRatio;
|
|
this.randomDampener = randomDampener;
|
|
this.worldDiscreteSize = worldDiscreteSize;
|
|
}
|
|
|
|
|
|
|
|
|
|
public Vector3f getWorldBoundMin(){
|
|
return worldMinPoint;
|
|
}
|
|
|
|
public Vector3f getWorldBoundMax(){
|
|
return worldMaxPoint;
|
|
}
|
|
|
|
public int getDynamicInterpolationRatio() {
|
|
return dynamicInterpolationRatio;
|
|
}
|
|
|
|
public float getRandomDampener() {
|
|
return randomDampener;
|
|
}
|
|
|
|
public int getWorldDiscreteSize() {
|
|
return worldDiscreteSize;
|
|
}
|
|
|
|
|
|
public int convertRealToChunkSpace(double real){
|
|
return (int)Math.floor(real / dynamicInterpolationRatio);
|
|
}
|
|
|
|
public float convertChunkToRealSpace(int chunk){
|
|
return chunk * dynamicInterpolationRatio;
|
|
}
|
|
|
|
}
|