Shape

abstract class Shape

Abstract class presenting a geometric shape.

Constructors

Link copied to clipboard
fun Shape()

Types

Link copied to clipboard
class IntersectionReturnElement(minPx: Double, minPy: Double, intersectionFound: Boolean, closestBody: TranslatableBody?, maxDistance: Double)

Functions

Link copied to clipboard
abstract fun calcMass(density: Double)

Calculates the mass of a shape.

Link copied to clipboard
abstract fun createAABB()

Generates an AABB for the shape.

Link copied to clipboard
abstract fun isPointInside(startPoint: Vec2): Boolean
Link copied to clipboard
abstract fun rayIntersect(startPoint: Vec2, endPoint: Vec2, maxDistance: Double, rayLength: Double): Shape.IntersectionReturnElement

Checks if a ray intersects with the shape.

Properties

Link copied to clipboard
lateinit var body: CollisionBodyInterface
Link copied to clipboard
var orientation: Mat2

Inheritors

Link copied to clipboard
Link copied to clipboard