Fix whitespace [skip actions]

This commit is contained in:
github-actions
2022-08-21 11:33:54 +00:00
parent a746d11b6f
commit c517b8a2c9
919 changed files with 754457 additions and 3136 deletions

View File

@@ -7,29 +7,29 @@ import lombok.Setter;
@Setter
public class SceneRegion {
public int config_id;
public int shape;
public Position pos;
public int config_id;
public int shape;
public Position pos;
// for CUBIC
public Position size;
public Position size;
// for SPHERE
public int radius;
public transient SceneGroup group;
public boolean contains(Position position) {
switch (shape) {
case ScriptRegionShape.CUBIC:
return (Math.abs(pos.getX() - position.getX()) <= size.getX()) &&
(Math.abs(pos.getY() - position.getY()) <= size.getY()) &&
(Math.abs(pos.getZ() - position.getZ()) <= size.getZ());
case ScriptRegionShape.SPHERE:
public boolean contains(Position position) {
switch (shape) {
case ScriptRegionShape.CUBIC:
return (Math.abs(pos.getX() - position.getX()) <= size.getX()) &&
(Math.abs(pos.getY() - position.getY()) <= size.getY()) &&
(Math.abs(pos.getZ() - position.getZ()) <= size.getZ());
case ScriptRegionShape.SPHERE:
var x = Math.pow(pos.getX() - position.getX(), 2);
var y = Math.pow(pos.getY() - position.getY(), 2);
var z = Math.pow(pos.getZ() - position.getZ(), 2);
// ^ means XOR in java!
return x + y + z <= (radius*radius);
}
return false;
}
return x + y + z <= (radius*radius);
}
return false;
}
}