-
- All Implemented Interfaces:
public abstract class ShapeAbstract class presenting a geometric shape.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classShape.IntersectionReturnElement
-
Field Summary
Fields Modifier and Type Field Description private CollisionBodyInterfacebodyprivate Mat2orientation
-
Constructor Summary
Constructors Constructor Description Shape()
-
Method Summary
Modifier and Type Method Description final CollisionBodyInterfacegetBody()final UnitsetBody(CollisionBodyInterface body)final Mat2getOrientation()final UnitsetOrientation(Mat2 orientation)abstract UnitcalcMass(Double density)Calculates the mass of a shape. abstract UnitcreateAABB()Generates an AABB for the shape. abstract BooleanisPointInside(Vec2 startPoint)abstract Shape.IntersectionReturnElementrayIntersect(Vec2 startPoint, Vec2 endPoint, Double maxDistance, Double rayLength)Checks if a ray intersects with the shape. -
-
Method Detail
-
getBody
final CollisionBodyInterface getBody()
-
setBody
final Unit setBody(CollisionBodyInterface body)
-
getOrientation
final Mat2 getOrientation()
-
setOrientation
final Unit setOrientation(Mat2 orientation)
-
calcMass
abstract Unit calcMass(Double density)
Calculates the mass of a shape.
- Parameters:
density- The desired density to factor into the calculation.
-
createAABB
abstract Unit createAABB()
Generates an AABB for the shape.
-
isPointInside
abstract Boolean isPointInside(Vec2 startPoint)
-
rayIntersect
abstract Shape.IntersectionReturnElement rayIntersect(Vec2 startPoint, Vec2 endPoint, Double maxDistance, Double rayLength)
Checks if a ray intersects with the shape.
- Parameters:
startPoint- The start point of the ray.endPoint- The end point of the ray.maxDistance- The ray information.
-
-
-
-