-
- All Superinterfaces:
Shiftable
,Translatable
- All Known Implementing Classes:
AbstractBounds
,AxisAlignedBounds
public interface Bounds extends Translatable, Shiftable
Represents theBounds
of a simulation.By default all bounds are
Translatable
but notRotatable
.Though not part of the bounds contract, a bounds object should only return true from the
isOutside(CollisionBody)
method when aCollisionBody
is fully outside the bounds. This applies to theisOutside(AABB)
andisOutside(AABB, Transform, Fixture)
methods as well.NOTE:
isOutside(AABB, Transform, Fixture)
method is called from the world implementations to provide the most flexibility. TheisOutside(CollisionBody)
andisOutside(AABB)
methods are NOT called internally.- Since:
- 1.0.0
- Version:
- 4.2.1
- Author:
- William Bittle
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Vector2
getTranslation()
Returns the translation of the bounds.boolean
isOutside(CollisionBody<?> body)
Returns true if the givenCollisionBody
is fully outside the bounds.boolean
isOutside(AABB aabb)
Returns true if the givenAABB
is fully outside the bounds.boolean
isOutside(AABB aabb, Transform transform, Fixture fixture)
-
Methods inherited from interface Translatable
translate, translate
-
-
-
-
Method Detail
-
getTranslation
Vector2 getTranslation()
Returns the translation of the bounds.- Returns:
Vector2
- Since:
- 3.2.0
-
isOutside
boolean isOutside(CollisionBody<?> body)
Returns true if the givenCollisionBody
is fully outside the bounds.If the
CollisionBody
contains zeroFixture
s thenCollisionBody
is considered to be outside the bounds.- Parameters:
body
- theCollisionBody
to test- Returns:
- boolean true if outside the bounds
-
isOutside
boolean isOutside(AABB aabb)
Returns true if the givenAABB
is fully outside the bounds.If the
AABB
is a degenerateAABB
(has zero area) then it's considered to be outside the bounds.- Parameters:
aabb
- theAABB
to test- Returns:
- boolean true if outside the bounds
- Since:
- 4.0.0
-
isOutside
boolean isOutside(AABB aabb, Transform transform, Fixture fixture)
Returns true if the givenAABB
orFixture
is fully outside the bounds.The implementation can use any of the provided information. For example, the
AxisAlignedBounds
class only uses the providedAABB
. For implementations of complex bounds, you can use theTransform
and shape contained in theFixture
.
-
-