DebugDraw class

Implement this abstract class to allow DBox2d to automatically draw your physics for debugging purposes. Not intended to replace your own custom rendering routines!

Implementers

Constructors

DebugDraw(ViewportTransform viewportTransform)
DebugDraw.zero()

Properties

drawFlags int
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
viewportTransform ViewportTransform
read / write

Methods

appendFlags(int flags) → void
clearFlags(int flags) → void
drawCircle(Vector2 center, double radius, Color3i color) → void
Draw a circle.
drawCircleAxis(Vector2 center, double radius, Vector2 axis, Color3i color) → void
Draws a circle with an axis
drawParticles(List<Vector2> centers, double radius, List<ParticleColor> colors, int count) → void
Draw a particle array @param colors can be null
drawParticlesWireframe(List<Vector2> centers, double radius, List<ParticleColor> colors, int count) → void
Draw a particle array @param colors can be null
drawPoint(Vector2 argPoint, double argRadiusOnScreen, Color3i argColor) → void
drawPolygon(List<Vector2> vertices, int vertexCount, Color3i color) → void
Draw a closed polygon provided in CCW order. This implementation uses {@link #drawSegment(Vec2, Vec2, Color3f)} to draw each side of the polygon.
drawSegment(Vector2 p1, Vector2 p2, Color3i color) → void
Draw a line segment.
drawSolidCircle(Vector2 center, double radius, Vector2 axis, Color3i color) → void
Draw a solid circle.
drawSolidPolygon(List<Vector2> vertices, int vertexCount, Color3i color) → void
Draw a solid closed polygon provided in CCW order.
drawString(Vector2 pos, String s, Color3i color) → void
drawStringXY(double x, double y, String s, Color3i color) → void
Draw a string.
drawTransform(Transform xf, Color3i color) → void
Draw a transform. Choose your own length scale
flush() → void
Called at the end of drawing a world
getScreenToWorld(Vector2 argScreen) Vector2
Takes the screen coordinates (argScreen) and returns the world coordinates
getScreenToWorldToOutXY(double screenX, double screenY) Vector2
Takes the screen coordinates and returns the corresponding world coordinates
getViewportTranform() ViewportTransform
getWorldToScreen(Vector2 argWorld) Vector2
Takes the world coordinate and returns the screen coordinates.
getWorldToScreenToOut(Vector2 input) Vector2
Takes the world coordinates and returns the corresponding screen coordinates
getWorldToScreenToOutXY(double worldX, double worldY) Vector2
Takes the world coordinates and returns the corresponding screen coordinates
getWorldToScreenXY(double worldX, double worldY) Vector2
Takes the world coordinates and returns the screen coordinates
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
setCamera(double x, double y, double scale) → void
@deprecated use the viewport transform in {@link #getViewportTranform()}
setViewportTransform(ViewportTransform viewportTransform) → void
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited

Constants

AABB_BIT → const int
Draw axis aligned bounding boxes
1 << 3
CENTER_OF_MASS_BIT → const int
Draw center of mass frame
1 << 5
DYNAMIC_TREE_BIT → const int
Draw dynamic tree
1 << 6
JOINT_BIT → const int
Draw joint connections
1 << 2
PAIR_BIT → const int
Draw pairs of connected objects
1 << 4
SHAPE_BIT → const int
Draw shapes
1 << 1
WIREFRAME_DRAWING_BIT → const int
Draw only the wireframe for drawing performance
1 << 7