C# Class Box2D.Callbacks.DebugDraw

Implement this abstract class to allow JBox2d to automatically draw your physics for debugging purposes. Not intended to replace your own custom rendering routines!
Show file Open project: gerich-home/box2dnet Class Usage Examples

Public Methods

Method Description
AppendFlags ( DrawFlags flags ) : void
ClearFlags ( DrawFlags flags ) : void
DrawCircle ( Vec2 center, float radius, Color3f color ) : void

Draw a circle.

DrawPoint ( Vec2 argPoint, float argRadiusOnScreen, Color3f argColor ) : void
DrawPolygon ( Vec2 vertices, int vertexCount, Color3f 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 ( Vec2 p1, Vec2 p2, Color3f color ) : void

Draw a line segment.

DrawSolidCircle ( Vec2 center, float radius, Vec2 axis, Color3f color ) : void

Draw a solid circle.

DrawSolidPolygon ( Vec2 vertices, int vertexCount, Color3f color ) : void

Draw a solid closed polygon provided in CCW order.

DrawString ( Vec2 pos, String s, Color3f color ) : void
DrawString ( float x, float y, String s, Color3f color ) : void

Draw a string.

DrawTransform ( Transform xf ) : void

Draw a transform. Choose your own length scale

GetScreenToWorld ( Vec2 argScreen ) : Vec2

takes the screen coordinates (argScreen) and returns the world coordinates

GetScreenToWorld ( float screenX, float screenY ) : Vec2

takes the screen coordinates and returns the world coordinates.

GetScreenToWorldToOut ( Vec2 argScreen, Vec2 argWorld ) : void
GetScreenToWorldToOut ( float screenX, float screenY, Vec2 argWorld ) : void

takes the screen coordinates and puts the corresponding world coordinates in argWorld.

GetWorldToScreen ( Vec2 argWorld ) : Vec2

takes the world coordinate (argWorld) and returns the screen coordinates.

GetWorldToScreen ( float worldX, float worldY ) : Vec2

Takes the world coordinates and returns the screen coordinates.

GetWorldToScreenToOut ( Vec2 argWorld, Vec2 argScreen ) : void
GetWorldToScreenToOut ( float worldX, float worldY, Vec2 argScreen ) : void

Takes the world coordinates and puts the corresponding screen coordinates in argScreen.

SetCamera ( float x, float y, float scale ) : void

Protected Methods

Method Description
DebugDraw ( IViewportTransform viewport ) : System

Method Details

AppendFlags() public method

public AppendFlags ( DrawFlags flags ) : void
flags DrawFlags
return void

ClearFlags() public method

public ClearFlags ( DrawFlags flags ) : void
flags DrawFlags
return void

DebugDraw() protected method

protected DebugDraw ( IViewportTransform viewport ) : System
viewport IViewportTransform
return System

DrawCircle() public abstract method

Draw a circle.
public abstract DrawCircle ( Vec2 center, float radius, Color3f color ) : void
center Box2D.Common.Vec2
radius float
color Box2D.Common.Color3f
return void

DrawPoint() public abstract method

public abstract DrawPoint ( Vec2 argPoint, float argRadiusOnScreen, Color3f argColor ) : void
argPoint Box2D.Common.Vec2
argRadiusOnScreen float
argColor Box2D.Common.Color3f
return void

DrawPolygon() public method

Draw a closed polygon provided in CCW order. This implementation uses {@link #drawSegment(Vec2, Vec2, Color3f)} to draw each side of the polygon.
public DrawPolygon ( Vec2 vertices, int vertexCount, Color3f color ) : void
vertices Box2D.Common.Vec2
vertexCount int
color Box2D.Common.Color3f
return void

DrawSegment() public abstract method

Draw a line segment.
public abstract DrawSegment ( Vec2 p1, Vec2 p2, Color3f color ) : void
p1 Box2D.Common.Vec2
p2 Box2D.Common.Vec2
color Box2D.Common.Color3f
return void

DrawSolidCircle() public abstract method

Draw a solid circle.
public abstract DrawSolidCircle ( Vec2 center, float radius, Vec2 axis, Color3f color ) : void
center Box2D.Common.Vec2
radius float
axis Box2D.Common.Vec2
color Box2D.Common.Color3f
return void

DrawSolidPolygon() public abstract method

Draw a solid closed polygon provided in CCW order.
public abstract DrawSolidPolygon ( Vec2 vertices, int vertexCount, Color3f color ) : void
vertices Box2D.Common.Vec2
vertexCount int
color Box2D.Common.Color3f
return void

DrawString() public method

public DrawString ( Vec2 pos, String s, Color3f color ) : void
pos Box2D.Common.Vec2
s String
color Box2D.Common.Color3f
return void

DrawString() public abstract method

Draw a string.
public abstract DrawString ( float x, float y, String s, Color3f color ) : void
x float
y float
s String
color Box2D.Common.Color3f
return void

DrawTransform() public abstract method

Draw a transform. Choose your own length scale
public abstract DrawTransform ( Transform xf ) : void
xf Box2D.Common.Transform
return void

GetScreenToWorld() public method

takes the screen coordinates (argScreen) and returns the world coordinates
public GetScreenToWorld ( Vec2 argScreen ) : Vec2
argScreen Box2D.Common.Vec2
return Box2D.Common.Vec2

GetScreenToWorld() public method

takes the screen coordinates and returns the world coordinates.
public GetScreenToWorld ( float screenX, float screenY ) : Vec2
screenX float
screenY float
return Box2D.Common.Vec2

GetScreenToWorldToOut() public method

public GetScreenToWorldToOut ( Vec2 argScreen, Vec2 argWorld ) : void
argScreen Box2D.Common.Vec2
argWorld Box2D.Common.Vec2
return void

GetScreenToWorldToOut() public method

takes the screen coordinates and puts the corresponding world coordinates in argWorld.
public GetScreenToWorldToOut ( float screenX, float screenY, Vec2 argWorld ) : void
screenX float
screenY float
argWorld Box2D.Common.Vec2
return void

GetWorldToScreen() public method

takes the world coordinate (argWorld) and returns the screen coordinates.
public GetWorldToScreen ( Vec2 argWorld ) : Vec2
argWorld Box2D.Common.Vec2
return Box2D.Common.Vec2

GetWorldToScreen() public method

Takes the world coordinates and returns the screen coordinates.
public GetWorldToScreen ( float worldX, float worldY ) : Vec2
worldX float
worldY float
return Box2D.Common.Vec2

GetWorldToScreenToOut() public method

public GetWorldToScreenToOut ( Vec2 argWorld, Vec2 argScreen ) : void
argWorld Box2D.Common.Vec2
argScreen Box2D.Common.Vec2
return void

GetWorldToScreenToOut() public method

Takes the world coordinates and puts the corresponding screen coordinates in argScreen.
public GetWorldToScreenToOut ( float worldX, float worldY, Vec2 argScreen ) : void
worldX float
worldY float
argScreen Box2D.Common.Vec2
return void

SetCamera() public method

public SetCamera ( float x, float y, float scale ) : void
x float
y float
scale float
return void