forked from SteamWar/SteamWar
Calculate hull visibility on block faces
Instead of a block occluding as a whole, the hull stores which of its six faces are full, using the occlusion shapes the client culls faces with. A ray inside a block can only leave it through an open face and enter the next block through its open opposite face; if only that face is full, the ray reaches its surface, so the block is visible, but stops there. Slabs, stairs and stacked slabs now hide what is behind them; double slabs need no special case anymore. Faces only open up on block updates, after which the rays that could not get into, out of or past the block are continued. Hidden blocks occlude by the same decision as the techhider, so waterlogged blocks count as well when water is hidden. The hull therefore takes the ObfuscationConfig, which the fight shares with its TechHiderWrapper.
This commit is contained in:
+1
-1
@@ -103,7 +103,7 @@ public class HullHiderCommand extends SWCommand implements Listener {
|
||||
|
||||
// The techhider of the gamemode is applied as well, its hidden blocks occlude as they are replaced by the obfuscation block
|
||||
ObfuscationConfig obfuscation = ObfuscationConfig.of(region.getGameModeConfig().Techhider);
|
||||
Hull hull = new Hull(BauSystem.getInstance(), world(), hullRegion, false, region.getGameModeConfig().Techhider.HiddenBlocks, new Viewers.VisibleByDefault());
|
||||
Hull hull = new Hull(BauSystem.getInstance(), world(), hullRegion, false, obfuscation, new Viewers.VisibleByDefault());
|
||||
hullHider.addHull(region, hull);
|
||||
hulls.put(region, new HiddenHull(hull, obfuscation.getObfuscationState()));
|
||||
hidingRules.put(region, HidingRule.of(region.getBuildArea(), obfuscation));
|
||||
|
||||
Reference in New Issue
Block a user