Debug draw
abstract class CP::Space::DebugDraw
inherits Reference
#
Direct known subclasses
SFMLDebugDraw
Constants#
COLLISION_POINT_COLOR = Color.new(1.0, 0.0, 0.0)
#
Color passed to drawing functions for collision points.
CONSTRAINT_COLOR = Color.new(0.0, 0.75, 0.0)
#
Color passed to drawing functions for constraints.
SHAPE_OUTLINE_COLOR = Color.new(*{200, 210, 230}.map(&./(255.0)))
#
Outline color passed to the drawing function.
Constructors#
Class methods#
Methods#
#color_for_shape(shape : Shape) : Color
#
Returns a color for a given shape.
This gives you an opportunity to color shapes based on how they are used in your engine.
abstract #draw_circle(pos : Vect, angle : Float64, radius : Float64, outline_color : Color, fill_color : Color)
#
Draw a filled, stroked circle.
abstract #draw_fat_segment(a : Vect, b : Vect, radius : Float64, outline_color : Color, fill_color : Color)
#
Draw a thick line segment.
abstract #draw_polygon(verts : Slice(Vect), radius : Float64, outline_color : Color, fill_color : Color)
#
Draw a convex polygon.
struct CP::Space::DebugDraw::Color
inherits Struct
#
class SFMLDebugDraw
inherits CP::Space::DebugDraw
#
Constructors#
Methods#
#draw_circle(pos : CP::Vect, angle : Float64, radius : Float64, outline_color : Color, fill_color : Color)
#
Draw a filled, stroked circle.
#draw_fat_segment(a : CP::Vect, b : CP::Vect, radius : Float64, outline_color : Color, fill_color : Color)
#
Draw a thick line segment.
#draw_polygon(verts : Slice(CP::Vect), radius : Float64, outline_color : Color, fill_color : Color)
#
Draw a convex polygon.
class SFMLDebugDraw::RoundedPolygon
inherits SF::Shape
#
Constructors#
Methods#
#get_point(index : Int) : SF::Vector2f
#
Get a point of the shape
The returned point is in local coordinates, that is, the shape's transforms (position, rotation, scale) are not taken into account. The result is undefined if index is out of the valid range.
- index - Index of the point to get, in range
0 ... point_count
Returns: index-th point of the shape
See also: point_count
#point_count : Int32
#
Get the total number of points of the shape
Returns: Number of points of the shape
See also: point