本文整理匯總了Java中com.sk89q.worldedit.Vector.getMinimum方法的典型用法代碼示例。如果您正苦於以下問題:Java Vector.getMinimum方法的具體用法?Java Vector.getMinimum怎麽用?Java Vector.getMinimum使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.sk89q.worldedit.Vector
的用法示例。
在下文中一共展示了Vector.getMinimum方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ExtendingCuboidRegionSelector
import com.sk89q.worldedit.Vector; //導入方法依賴的package包/類
/**
* Create a new selector.
*
* @param world the world
* @param position1 the first position
* @param position2 the second position
*/
public ExtendingCuboidRegionSelector(@Nullable World world, Vector position1, Vector position2) {
this(world);
position1 = Vector.getMinimum(position1, position2);
position2 = Vector.getMaximum(position1, position2);
region.setPos1(position1);
region.setPos2(position2);
}
示例2: getMinimumPoint
import com.sk89q.worldedit.Vector; //導入方法依賴的package包/類
@Override
public Vector getMinimumPoint() {
Vector pos1 = new MutableBlockVector(getPos(super.getMinimumPoint()));
Vector pos2 = new MutableBlockVector(getPos(super.getMaximumPoint()));
return Vector.getMinimum(pos1, pos2);
}
示例3: getTransformedRegion
import com.sk89q.worldedit.Vector; //導入方法依賴的package包/類
/**
* Get the transformed region.
*
* @return the transformed region
*/
public Region getTransformedRegion() {
Region region = original.getRegion();
Vector minimum = region.getMinimumPoint();
Vector maximum = region.getMaximumPoint();
Transform transformAround =
new CombinedTransform(
new AffineTransform().translate(original.getOrigin().multiply(-1)),
transform,
new AffineTransform().translate(original.getOrigin()));
// new Vector(minimum.getX(), minimum.getY(), minimum.getZ())
// new Vector(maximum.getX(), maximum.getY(), maximum.getZ())
Vector[] corners = new Vector[]{
minimum,
maximum,
new Vector(maximum.getX(), minimum.getY(), minimum.getZ()),
new Vector(minimum.getX(), maximum.getY(), minimum.getZ()),
new Vector(minimum.getX(), minimum.getY(), maximum.getZ()),
new Vector(minimum.getX(), maximum.getY(), maximum.getZ()),
new Vector(maximum.getX(), minimum.getY(), maximum.getZ()),
new Vector(maximum.getX(), maximum.getY(), minimum.getZ())};
for (int i = 0; i < corners.length; i++) {
corners[i] = transformAround.apply(new Vector(corners[i]));
}
Vector newMinimum = corners[0];
Vector newMaximum = corners[0];
for (int i = 1; i < corners.length; i++) {
newMinimum = Vector.getMinimum(newMinimum, corners[i]);
newMaximum = Vector.getMaximum(newMaximum, corners[i]);
}
// After transformation, the points may not really sit on a block,
// so we should expand the region for edge cases
newMinimum.mutX(Math.ceil(Math.floor(newMinimum.getX())));
newMinimum.mutY(Math.ceil(Math.floor(newMinimum.getY())));
newMinimum.mutZ(Math.ceil(Math.floor(newMinimum.getZ())));
return new CuboidRegion(newMinimum, newMaximum);
}