-
-
Field Summary
Fields Modifier and Type Field Description private Doubleradiusprivate CollisionBodyInterfacebodyprivate Mat2orientation
-
Method Summary
Modifier and Type Method Description final DoublegetRadius()final UnitsetRadius(Double radius)final CollisionBodyInterfacegetBody()final UnitsetBody(CollisionBodyInterface body)final Mat2getOrientation()final UnitsetOrientation(Mat2 orientation)UnitcalcMass(Double density)Calculates the mass of a circle. UnitcreateAABB()Generates an AABB and binds it to the body. BooleanisPointInside(Vec2 startPoint)Method to check if point is inside a body in world space. Shape.IntersectionReturnElementrayIntersect(Vec2 startPoint, Vec2 endPoint, Double maxDistance, Double rayLength)Checks if a ray intersects with the shape. -
-
Constructor Detail
-
Circle
Circle(Double radius)
-
-
Method Detail
-
getBody
final CollisionBodyInterface getBody()
-
setBody
final Unit setBody(CollisionBodyInterface body)
-
getOrientation
final Mat2 getOrientation()
-
setOrientation
final Unit setOrientation(Mat2 orientation)
-
calcMass
Unit calcMass(Double density)
Calculates the mass of a circle.
- Parameters:
density- The desired density to factor into the calculation.
-
createAABB
Unit createAABB()
Generates an AABB and binds it to the body.
-
isPointInside
Boolean isPointInside(Vec2 startPoint)
Method to check if point is inside a body in world space.
- Parameters:
startPoint- Vector point to check if its inside the first body.
-
rayIntersect
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.
-
-
-
-