Made seasurface overlay to enable skybox to be smaller. #story[1261]

This commit is contained in:
Joseph
2017-09-12 12:37:25 +12:00
parent 49cd19e1a8
commit 7a8ea7fea7
4 changed files with 16 additions and 6 deletions
@@ -26,10 +26,11 @@ public class SeaSurface {
* @param x offset that the sea should be set at position-wise
* @param z offset that the sea should be set at position-wise
*/
public SeaSurface(int size, double freq, double x, double z){
public SeaSurface(int size, double freq, double x, double y, double z){
noiseArray = PerlinNoiseGenerator.createNoise(size, freq);
createSurface();
surface.setZ(z);
surface.setY(y);
surface.setX(x);
}
@@ -33,11 +33,12 @@ public class SkyBox {
}
private void makeSkyBox() {
addTop();
//addTop();
addFront();
addBack();
addLeft();
addRight();
addSeaOverlay();
}
private void addTop() {
@@ -142,6 +143,11 @@ public class SkyBox {
return surface;
}
private void addSeaOverlay() {
SeaSurface seaSurface = new SeaSurface(size * 3, 200, x, y - size/4 + 1, z);
skyBoxPlanes.add(seaSurface.getSurface());
}
/**
* Create texture for uv mapping
@@ -198,7 +198,7 @@ public class View3D extends Pane {
target.getHeading().angleProperty().addListener(pivotHeading);
this.setDistance(THIRD_PERSON_LIMIT);
this.setPitch(20);
this.setPitch(15);
}
public void setNearClip(double nearClip) {