farm plots place dirt
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
81f79232e1
commit
c863365c26
@ -2043,6 +2043,7 @@ Rendering prism regions
|
||||
Utilities for turning mesh gen algos into renderable entities
|
||||
Back off farm plots from roads by road radius
|
||||
Farm plots properly save/load to/from disk
|
||||
Farm plots place dirt
|
||||
|
||||
|
||||
|
||||
|
||||
@ -419,6 +419,7 @@ public class MacroData {
|
||||
List<MacroAreaObject> blockers = new LinkedList<MacroAreaObject>();
|
||||
blockers.addAll(this.structures);
|
||||
blockers.addAll(this.roads);
|
||||
blockers.addAll(this.regions);
|
||||
return blockers;
|
||||
}
|
||||
|
||||
|
||||
@ -1,12 +1,16 @@
|
||||
package electrosphere.server.macro.region;
|
||||
|
||||
import org.joml.AABBd;
|
||||
import org.joml.Vector3d;
|
||||
|
||||
import electrosphere.server.macro.MacroData;
|
||||
import electrosphere.server.macro.spatial.MacroAreaObject;
|
||||
import electrosphere.util.math.region.Region;
|
||||
|
||||
/**
|
||||
* A macro data spatial region
|
||||
*/
|
||||
public class MacroRegion {
|
||||
public class MacroRegion implements MacroAreaObject {
|
||||
|
||||
|
||||
/**
|
||||
@ -64,6 +68,21 @@ public class MacroRegion {
|
||||
this.region = region;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector3d getPos() {
|
||||
return new Vector3d(this.region.getAABB().minX,this.region.getAABB().minY,this.region.getAABB().minZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPos(Vector3d pos) {
|
||||
throw new UnsupportedOperationException("Unimplemented method 'setPos'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public AABBd getAABB() {
|
||||
return this.region.getAABB();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -14,6 +14,7 @@ import electrosphere.data.voxel.sampler.SamplerFile;
|
||||
import electrosphere.engine.Globals;
|
||||
import electrosphere.server.datacell.ServerWorldData;
|
||||
import electrosphere.server.macro.civilization.road.Road;
|
||||
import electrosphere.server.macro.region.MacroRegion;
|
||||
import electrosphere.server.macro.spatial.MacroObject;
|
||||
import electrosphere.server.macro.structure.VirtualStructure;
|
||||
import electrosphere.server.macro.town.Town;
|
||||
@ -307,6 +308,15 @@ public class ProceduralChunkGenerator implements ChunkGenerator {
|
||||
}
|
||||
}
|
||||
} else if(object instanceof Town){
|
||||
} else if(object instanceof MacroRegion region){
|
||||
if(region.getRegion().getAABB().testPoint(realPt)){
|
||||
if(region.getRegion().intersects(realPt)){
|
||||
if(voxel.type != ServerTerrainChunk.VOXEL_TYPE_AIR){
|
||||
voxel.type = 1;
|
||||
rVal = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new Error("Unsupported object type " + object);
|
||||
}
|
||||
|
||||
@ -179,6 +179,7 @@ public class ChunkGenerationThread implements Runnable {
|
||||
Town town = (Town)currObj;
|
||||
List<VirtualStructure> structs = town.getStructures(macroData);
|
||||
objects.addAll(structs);
|
||||
objects.addAll(town.getFarmPlots(macroData));
|
||||
}
|
||||
//filter to just objects that are within bounds of the chunk
|
||||
AABBd chunkAABB = new AABBd(ServerWorldData.convertChunkToRealSpace(new Vector3i(worldX,worldY,worldZ)), ServerWorldData.convertChunkToRealSpace(new Vector3i(worldX+1,worldY+1,worldZ+1)));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user