Class Collider
java.lang.Object
dev.prozilla.pine.core.component.Component
dev.prozilla.pine.core.component.physics.collision.Collider
- All Implemented Interfaces:
Destructible,Printable,ApplicationContext,ApplicationProvider,ComponentsContext,ComponentsProvider,EntityContext,EntityProvider,ColoredDrawable,Drawable,SceneContext,SceneProvider
- Direct Known Subclasses:
CircleCollider,RectCollider
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ColorThe offset of this collider from the entity's position. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancollidesWith(Collider other) Checks if this collider collides with another collider.voidDraws this collider in a green tint.voidDraws this collider in a green tint.voidDraws this collider in a given color.voidDraws this collider in a given color.floatfloatMethods inherited from class dev.prozilla.pine.core.component.Component
destroy, equals, getApplication, getEntity, getName, getScene, hashCode, onEntityChange, setActive, setEntity, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.prozilla.pine.core.ApplicationProvider
getAudioDevice, getConfig, getInput, getLocalStorage, getLogger, getModManager, getRenderer, getTimer, getTracker, getWindowMethods inherited from interface dev.prozilla.pine.core.component.ComponentsProvider
getComponent, getComponentInParent, getComponentInParent, getComponents, getComponentsInChildrenMethods inherited from interface dev.prozilla.pine.core.entity.EntityContext
isDescendantOfMethods inherited from interface dev.prozilla.pine.core.entity.EntityProvider
getChild, getChildWithTag, getFirstChild, getLastChild, getParentWithTag, getTransform, isDescendantOfMethods inherited from interface dev.prozilla.pine.core.scene.SceneProvider
getCameraData, getWorld
-
Field Details
-
offset
The offset of this collider from the entity's position. -
DEFAULT_COLOR
-
-
Constructor Details
-
Collider
Creates a collider with a given offset.- Parameters:
offset- The offset of the collider
-
-
Method Details
-
collidesWith
Checks if this collider collides with another collider.- Parameters:
other- The other collider- Returns:
trueif the colliders are colliding.
-
getOrigin
-
getOriginX
public float getOriginX() -
getOriginY
public float getOriginY() -
draw
Draws this collider in a green tint.- Parameters:
renderer- The renderer
-
draw
Draws this collider in a green tint.- Specified by:
drawin interfaceColoredDrawable- Specified by:
drawin interfaceDrawable- Parameters:
renderer- The rendererdepth- The depth of the entity
-
draw
Draws this collider in a given color.- Parameters:
renderer- The renderercolor- The color to draw with
-
draw
Draws this collider in a given color.- Specified by:
drawin interfaceColoredDrawable- Parameters:
renderer- The renderercolor- The color to draw withdepth- The depth of the entity
-