java.lang.Object
dev.aurumbyte.sypherengine.components.Component
dev.aurumbyte.sypherengine.components.AABB
Axis Aligned Bounding Box collider, also a component that can be added.
- Since:
- v0.3.0
- Author:
- AurumByte
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionjavafx.geometry.Rectangle2D
The base JavaFX class, the core of the AABB functionality(package private) float
Width and height of the AABB(package private) Entity
The parent entity of the AABBPosition of the AABB(package private) boolean
Field to show whether the AABB is in debug mode or not(package private) float
Width and height of the AABBFields inherited from class dev.aurumbyte.sypherengine.components.Component
componentTag
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isCollidingWith
(Entity other) check if the current entity, over which the AABB acts as a collider, collides with another entityboolean
isEntityInside
(Entity other) check if anything is inside the current entityboolean
isInsideOf
(Entity other) check if the current entity, over which the AABB acts as a collider, is inside another entityboolean
isPointInsideOf
(Vector2 point) check if the current x and y coords of the point lies within the boundaries of the current entityvoid
render
(SypherEngine engine) Render the AABB borders, if the AABB is in debug modevoid
setBoundingBox
(Vector2 position, int width, int height) Setting the AABB to a specific location, width and heightvoid
setIfDebug
(boolean shouldDebug) Toggle the debug mode of the AABBvoid
update
(float deltaTime) Updating the AABBMethods inherited from class dev.aurumbyte.sypherengine.components.Component
getAABBComponent
-
Field Details
-
position
Position of the AABB -
width
float widthWidth and height of the AABB -
height
float heightWidth and height of the AABB -
shouldDebug
boolean shouldDebugField to show whether the AABB is in debug mode or not -
boundingBox
public javafx.geometry.Rectangle2D boundingBoxThe base JavaFX class, the core of the AABB functionality -
parent
Entity parentThe parent entity of the AABB
-
-
Constructor Details
-
AABB
A new AABB, attached to a parent
- Parameters:
parent
- The entity to which the AABB acts as a collider- Since:
- 0.3.0
-
AABB
A new AABB, with a specified location, width and height
- Parameters:
position
- The position of the AABBwidth
- The width of the AABBheight
- The height of the AABB- Since:
- 0.3.0
-
-
Method Details
-
update
public void update(float deltaTime) Updating the AABB
-
render
Render the AABB borders, if the AABB is in debug mode
-
isCollidingWith
check if the current entity, over which the AABB acts as a collider, collides with another entity
- Parameters:
other
- the other entity- Since:
- 0.3.0
-
isInsideOf
check if the current entity, over which the AABB acts as a collider, is inside another entity
- Parameters:
other
- the entity, in which the current entity may or may not be inside of- Since:
- 0.3.0
-
isEntityInside
check if anything is inside the current entity
- Parameters:
other
- the entity which may or may not be inside the current entity- Since:
- 0.3.0
-
isPointInsideOf
check if the current x and y coords of the point lies within the boundaries of the current entity
- Parameters:
point
- the coords to be checked- Since:
- 0.3.0
-
setIfDebug
public void setIfDebug(boolean shouldDebug) Toggle the debug mode of the AABB
- Parameters:
shouldDebug
- value for the debug field.- Since:
- 0.3.0
-
setBoundingBox
Setting the AABB to a specific location, width and height
- Parameters:
position
- The position of the AABBwidth
- The width of the AABBheight
- The height of the AABB- Since:
- 0.3.0
-