class
Eagle::Physics2D::Circle
- Eagle::Physics2D::Circle
- Eagle::Physics2D::Shape
- Reference
- Object
Overview
A circle collision shape.
Physics2D::Circle.new(16)
Physics2D::Circle.new(8, offset: v2(0, -20)) # a head above the body's origin
Defined in:
eagle/physics/shapes2d.crConstructors
-
.new(radius : Number, offset : Vec2 = Vec2::ZERO)
Creates a circle of radius, offset from the body's origin.
Instance Method Summary
-
#aabb : Rect
Bounds in world space.
-
#area : Float32
Area of the circle.
-
#center : Vec2
Center in world space, on transformed shapes.
-
#center=(center : Vec2)
Center in world space, on transformed shapes.
-
#contains?(p : Vec2) : Bool
True when p is inside the circle.
-
#inertia_factor : Float32
Inertia per unit mass.
-
#local_aabb : Rect
Bounds in local space.
-
#radius : Float32
Radius in pixels.
-
#radius=(radius : Float32)
Radius in pixels.
-
#transformed(t : Transform2D) : Shape
A world-space copy.
Instance methods inherited from class Eagle::Physics2D::Shape
aabb : Rect
aabb,
area : Float32
area,
inertia_factor : Float32
inertia_factor,
local_aabb : Rect
local_aabb,
offset : Vec2
offset,
offset=(offset : Vec2)
offset=,
transformed(t : Transform2D) : Shape
transformed
Constructor Detail
Creates a circle of radius, offset from the body's origin.