org.jbox2d.testbed
Class ProcessingDebugDraw
java.lang.Object
org.jbox2d.dynamics.DebugDraw
org.jbox2d.testbed.ProcessingDebugDraw
public class ProcessingDebugDraw
- extends DebugDraw
Implementation of DebugDraw using Processing (http://www.processing.org)
- Author:
- ewjordan
Method Summary |
void |
drawCircle(Vec2 center,
float radius,
javax.vecmath.Color3f color)
|
void |
drawPoint(Vec2 position,
float f,
javax.vecmath.Color3f color)
|
void |
drawPolygon(Vec2[] vertices,
int vertexCount,
javax.vecmath.Color3f color)
|
void |
drawSegment(Vec2 p1,
Vec2 p2,
javax.vecmath.Color3f color)
|
void |
drawSolidCircle(Vec2 center,
float radius,
Vec2 axis,
javax.vecmath.Color3f color)
|
void |
drawSolidPolygon(Vec2[] vertices,
int vertexCount,
javax.vecmath.Color3f color)
|
void |
drawString(float x,
float y,
java.lang.String s,
javax.vecmath.Color3f color)
|
void |
drawXForm(XForm xf)
|
Vec2 |
screenToWorld(float x,
float y)
|
Vec2 |
screenToWorld(Vec2 screen)
|
void |
setCamera(float x,
float y,
float scale)
Stub method to overload for camera movement/zoom. |
Vec2 |
worldToScreen(float x,
float y)
|
Vec2 |
worldToScreen(Vec2 world)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
screen
public static ProcessingDebugDraw screen
g
public processing.core.PApplet g
m_font
public processing.core.PFont m_font
fontHeight
public float fontHeight
transX
public float transX
transY
public float transY
scaleFactor
public float scaleFactor
yFlip
public float yFlip
ProcessingDebugDraw
public ProcessingDebugDraw(processing.core.PApplet pApplet)
setCamera
public void setCamera(float x,
float y,
float scale)
- Description copied from class:
DebugDraw
- Stub method to overload for camera movement/zoom.
- Overrides:
setCamera
in class DebugDraw
- Parameters:
x
- - x coordinate of cameray
- - y coordinate of camerascale
- - zoom factor
worldToScreen
public Vec2 worldToScreen(Vec2 world)
- Overrides:
worldToScreen
in class DebugDraw
- Parameters:
world
- World position
- Returns:
- Screen position
worldToScreen
public Vec2 worldToScreen(float x,
float y)
- Overrides:
worldToScreen
in class DebugDraw
- Parameters:
x
- World x positiony
- World y position
- Returns:
- Screen position
screenToWorld
public Vec2 screenToWorld(Vec2 screen)
- Overrides:
screenToWorld
in class DebugDraw
- Parameters:
screen
- Screen position
- Returns:
- World position
screenToWorld
public Vec2 screenToWorld(float x,
float y)
- Overrides:
screenToWorld
in class DebugDraw
- Parameters:
x
- Screen x positiony
- Screey y position
- Returns:
- World position
drawCircle
public void drawCircle(Vec2 center,
float radius,
javax.vecmath.Color3f color)
- Specified by:
drawCircle
in class DebugDraw
drawSolidCircle
public void drawSolidCircle(Vec2 center,
float radius,
Vec2 axis,
javax.vecmath.Color3f color)
- Specified by:
drawSolidCircle
in class DebugDraw
drawPolygon
public void drawPolygon(Vec2[] vertices,
int vertexCount,
javax.vecmath.Color3f color)
- Specified by:
drawPolygon
in class DebugDraw
drawSolidPolygon
public void drawSolidPolygon(Vec2[] vertices,
int vertexCount,
javax.vecmath.Color3f color)
- Specified by:
drawSolidPolygon
in class DebugDraw
drawSegment
public void drawSegment(Vec2 p1,
Vec2 p2,
javax.vecmath.Color3f color)
- Specified by:
drawSegment
in class DebugDraw
drawXForm
public void drawXForm(XForm xf)
- Specified by:
drawXForm
in class DebugDraw
drawString
public void drawString(float x,
float y,
java.lang.String s,
javax.vecmath.Color3f color)
- Specified by:
drawString
in class DebugDraw
drawPoint
public void drawPoint(Vec2 position,
float f,
javax.vecmath.Color3f color)
- Specified by:
drawPoint
in class DebugDraw