-
-
Field Summary
Fields Modifier and Type Field Description private Double
radius
private CollisionBodyInterface
body
private Mat2
orientation
-
Method Summary
Modifier and Type Method Description final Double
getRadius()
final Unit
setRadius(Double radius)
final CollisionBodyInterface
getBody()
final Unit
setBody(CollisionBodyInterface body)
final Mat2
getOrientation()
final Unit
setOrientation(Mat2 orientation)
Unit
calcMass(Double density)
Calculates the mass of a circle. Unit
createAABB()
Generates an AABB and binds it to the body. Boolean
isPointInside(Vec2 startPoint)
Method to check if point is inside a body in world space. Shape.IntersectionReturnElement
rayIntersect(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.
-
-
-
-