Module technology.sola.engine
Record Class ColliderShapeConvexPolygon
java.lang.Object
java.lang.Record
technology.sola.engine.physics.component.collider.ColliderShapeConvexPolygon
- Record Components:
shape- the convex polygon shape of this collider
- All Implemented Interfaces:
ColliderShape<ConvexPolygon>
@NullMarked
public record ColliderShapeConvexPolygon(ConvexPolygon shape)
extends Record
implements ColliderShape<ConvexPolygon>
ColliderShapeConvexPolygon is a
ColliderShape implementation for a convex polygon which utilize a
ConvexPolygon for its geometric shape representation.-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of aColliderShapeConvexPolygonrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoiddebugRender(Renderer renderer, TransformComponent transformComponent, float offsetX, float offsetY) Renders debug information for the collider shape.final booleanIndicates whether some other object is "equal to" this one.getBoundingBox(TransformComponent transformComponent, float offsetX, float offsetY) Returns the bounding box for thisColliderShape.getShape(TransformComponent transformComponent, float offsetX, float offsetY) Gets the geometricShapefor this collider shape.final inthashCode()Returns a hash code value for this object.shape()Returns the value of theshaperecord component.final StringtoString()Returns a string representation of this record class.type()Gets theColliderTypeof this collider.
-
Constructor Details
-
ColliderShapeConvexPolygon
Creates an instance of aColliderShapeConvexPolygonrecord class.- Parameters:
shape- the value for theshaperecord component
-
-
Method Details
-
type
Description copied from interface:ColliderShapeGets theColliderTypeof this collider.- Specified by:
typein interfaceColliderShape<ConvexPolygon>- Returns:
- the
ColliderTypeof this collider
-
getBoundingBox
public Rectangle getBoundingBox(TransformComponent transformComponent, float offsetX, float offsetY) Description copied from interface:ColliderShapeReturns the bounding box for thisColliderShape.- Specified by:
getBoundingBoxin interfaceColliderShape<ConvexPolygon>- Parameters:
transformComponent- theTransformComponentof the entityoffsetX- the x offset of the collideroffsetY- the y offset of the collider- Returns:
- the bounding box
-
getShape
Description copied from interface:ColliderShapeGets the geometricShapefor this collider shape.- Specified by:
getShapein interfaceColliderShape<ConvexPolygon>- Parameters:
transformComponent- theTransformComponentfor theEntityoffsetX- the x offset off the collideroffsetY- the y offset of the collider- Returns:
- the geometric
Shape
-
debugRender
public void debugRender(Renderer renderer, TransformComponent transformComponent, float offsetX, float offsetY) Description copied from interface:ColliderShapeRenders debug information for the collider shape.- Specified by:
debugRenderin interfaceColliderShape<ConvexPolygon>- Parameters:
renderer- theRenderertransformComponent- theEntity'sTransformComponentoffsetX- the collider shape x-axis offsetoffsetY- the collider shape y-axis offset
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
shape
Returns the value of theshaperecord component.- Returns:
- the value of the
shaperecord component
-