abstract class CP::Space::DebugDraw

Direct Known Subclasses

Defined in:

chipmunk/debug_draw.cr

Constant Summary

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 Method Summary

Instance Method Summary

Constructor Detail

def self.new(flags : CP::Space::DebugDraw::Flags = Flags::All) #

[View source]

Class Method Detail

def self.color_for_hash(hash : Int, intensity : Number) : Color #

[View source]

Instance Method Detail

def 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.


[View source]
def draw(space : Space) #

Debug draw the current state of the space.


[View source]
abstract def draw_circle(pos : Vect, angle : Float64, radius : Float64, outline_color : Color, fill_color : Color) #

Draw a filled, stroked circle.


[View source]
abstract def draw_dot(size : Float64, pos : Vect, color : Color) #

Draw a dot.


[View source]
abstract def draw_fat_segment(a : Vect, b : Vect, radius : Float64, outline_color : Color, fill_color : Color) #

Draw a thick line segment.


[View source]
abstract def draw_polygon(verts : Slice(Vect), radius : Float64, outline_color : Color, fill_color : Color) #

Draw a convex polygon.


[View source]
abstract def draw_segment(a : Vect, b : Vect, color : Color) #

Draw a line segment.


[View source]
def flags : Flags #

[View source]
def flags=(flags : Flags) #

[View source]