Skip to content

Commit

Permalink
More accurate comments
Browse files Browse the repository at this point in the history
  • Loading branch information
TomyLobo committed Mar 23, 2023
1 parent bdabd6b commit a43ccd8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2362,12 +2362,13 @@ public int deformRegion(final Region region, final Vector3 zero, final Vector3 u
final DoubleArrayList<BlockVector3, BaseBlock> queue = new DoubleArrayList<>(false);

for (BlockVector3 position : region) {
// offset, scale
// transform
final Vector3 scaled = position.toVector3().subtract(zero).divide(unit);

// transform
// deform
expression.evaluate(new double[]{scaled.getX(), scaled.getY(), scaled.getZ()}, timeout);

// untransform, round-nearest
final BlockVector3 sourcePosition = environment.toWorld(x.getValue(), y.getValue(), z.getValue());

// read block from world
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public WorldEditExpressionEnvironment(Extent extent, Vector3 unit, Vector3 zero)
}

public BlockVector3 toWorld(double x, double y, double z) {
// unscale, unoffset, round-nearest
return Vector3.at(x, y, z).multiply(unit).add(zero2).toBlockPoint();
}

Expand Down

0 comments on commit a43ccd8

Please sign in to comment.