Hi! Why does the getSize() method return a Vector3d value that is less than one for each axis? For example, AABB(1, 1, 1, 2, 2, 2).getSize() returns Vector3d(1, 1, 1). Is it a bug or a feature?
Have you tried AABB(1,1,1,4,4,4)
? It returns Vector(3,3,3)
…
What AABB#getSize returns is the difference on between the X
s, the difference between the Y
s, and the difference between the Z
s.
Therefor AABB(1,1,1,2,2,2)
SHOULD return Vector(1,1,1)
because that is the difference between one and two.
This is the actual code for the getSize method:
// This file is part of SpongeAPI, licensed under the MIT License (MIT).
public Vector3d getSize() {
if (this.size == null) {
this.size = this.max.sub(this.min);
}
return this.size;
}
-edit- I am not really sure what you mean by it returns less than 1 for each axis?
I already understood my mistake. The fact is that this class works with points, not with blocks. And I needed a class like CuboidSelection in WorldEdit.