Class AABB
java.lang.Object
me.moros.bending.api.collision.geometry.AABB
- All Implemented Interfaces:
Collider
Axis aligned bounding box.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionat
(me.moros.math.Position point) Calculate a new collider as if this instance was moved.boolean
contains
(me.moros.math.Vector3d point) Check if the given point is within the space of this collider.static AABB
dummy()
Get a dummy AABB collider.boolean
static AABB
static AABB
fromRay
(me.moros.math.Vector3d start, me.moros.math.Vector3d dir, double raySize) grow
(me.moros.math.Vector3d diff) Calculate an AABB by expanding this instance by the given amount in each component.me.moros.math.Vector3d
Calculate the half extents for this collider.int
hashCode()
me.moros.math.Vector3d
position()
Get the center position for this collider.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface me.moros.bending.api.collision.geometry.Collider
intersects
-
Field Details
-
BLOCK_BOUNDS
-
EXPANDED_BLOCK_BOUNDS
-
min
public final me.moros.math.Vector3d min -
max
public final me.moros.math.Vector3d max
-
-
Constructor Details
-
AABB
public AABB(me.moros.math.Vector3d min, me.moros.math.Vector3d max)
-
-
Method Details
-
grow
Calculate an AABB by expanding this instance by the given amount in each component. The expansion is uniform and will affect both the min and max points. For example, expandingBLOCK_BOUNDS
(1x1x1 box) byVector3d.ONE
will result in a 3x3x3 box.- Parameters:
diff
- the amount to expand- Returns:
- the expanded AABB
-
position
public me.moros.math.Vector3d position()Description copied from interface:Collider
Get the center position for this collider. -
at
Description copied from interface:Collider
Calculate a new collider as if this instance was moved. -
halfExtents
public me.moros.math.Vector3d halfExtents()Description copied from interface:Collider
Calculate the half extents for this collider.- Specified by:
halfExtents
in interfaceCollider
- Returns:
- this half extents for this collider
-
contains
public boolean contains(me.moros.math.Vector3d point) Description copied from interface:Collider
Check if the given point is within the space of this collider. -
equals
-
hashCode
public int hashCode() -
dummy
Get a dummy AABB collider.- Returns:
- a dummy collider
-
fromRay
-
fromRay
public static AABB fromRay(me.moros.math.Vector3d start, me.moros.math.Vector3d dir, double raySize)
-