public abstract class DebugDraw extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
e_aabbBit
Draw axis aligned bounding boxes
|
static int |
e_centerOfMassBit
Draw center of mass frame
|
static int |
e_dynamicTreeBit
Draw dynamic tree
|
static int |
e_jointBit
Draw joint connections
|
static int |
e_pairBit
Draw pairs of connected objects
|
static int |
e_shapeBit
Draw shapes
|
static int |
e_wireframeDrawingBit
Draw only the wireframe for drawing performance
|
protected int |
m_drawFlags |
protected IViewportTransform |
viewportTransform |
| Constructor and Description |
|---|
DebugDraw() |
DebugDraw(IViewportTransform viewport) |
| Modifier and Type | Method and Description |
|---|---|
void |
appendFlags(int flags) |
void |
clearFlags(int flags) |
abstract void |
drawCircle(Vec2 center,
float radius,
javafx.scene.paint.Color color)
Draw a circle.
|
void |
drawCircle(Vec2 center,
float radius,
Vec2 axis,
javafx.scene.paint.Color color)
Draws a circle with an axis
|
abstract void |
drawParticles(Vec2[] centers,
float radius,
ParticleColor[] colors,
int count)
Draw a particle array
|
abstract void |
drawParticlesWireframe(Vec2[] centers,
float radius,
ParticleColor[] colors,
int count)
Draw a particle array
|
abstract void |
drawPoint(Vec2 argPoint,
float argRadiusOnScreen,
javafx.scene.paint.Color argColor) |
void |
drawPolygon(Vec2[] vertices,
int vertexCount,
javafx.scene.paint.Color color)
Draw a closed polygon provided in CCW order.
|
abstract void |
drawSegment(Vec2 p1,
Vec2 p2,
javafx.scene.paint.Color color)
Draw a line segment.
|
abstract void |
drawSolidCircle(Vec2 center,
float radius,
Vec2 axis,
javafx.scene.paint.Color color)
Draw a solid circle.
|
abstract void |
drawSolidPolygon(Vec2[] vertices,
int vertexCount,
javafx.scene.paint.Color color)
Draw a solid closed polygon provided in CCW order.
|
abstract void |
drawString(float x,
float y,
String s,
javafx.scene.paint.Color color)
Draw a string.
|
void |
drawString(Vec2 pos,
String s,
javafx.scene.paint.Color color) |
abstract void |
drawTransform(Transform xf)
Draw a transform.
|
void |
flush()
Called at the end of drawing a world
|
int |
getFlags() |
Vec2 |
getScreenToWorld(float screenX,
float screenY)
takes the screen coordinates and returns the world coordinates.
|
Vec2 |
getScreenToWorld(Vec2 argScreen)
takes the screen coordinates (argScreen) and returns the world coordinates
|
void |
getScreenToWorldToOut(float screenX,
float screenY,
Vec2 argWorld)
takes the screen coordinates and puts the corresponding world coordinates in argWorld.
|
void |
getScreenToWorldToOut(Vec2 argScreen,
Vec2 argWorld) |
IViewportTransform |
getViewportTranform() |
Vec2 |
getWorldToScreen(float worldX,
float worldY)
Takes the world coordinates and returns the screen coordinates.
|
Vec2 |
getWorldToScreen(Vec2 argWorld)
takes the world coordinate (argWorld) and returns the screen coordinates.
|
void |
getWorldToScreenToOut(float worldX,
float worldY,
Vec2 argScreen)
Takes the world coordinates and puts the corresponding screen coordinates in argScreen.
|
void |
getWorldToScreenToOut(Vec2 argWorld,
Vec2 argScreen) |
void |
setCamera(float x,
float y,
float scale)
Deprecated.
use the viewport transform in
getViewportTranform() |
void |
setFlags(int flags) |
void |
setViewportTransform(IViewportTransform viewportTransform) |
public static final int e_shapeBit
public static final int e_jointBit
public static final int e_aabbBit
public static final int e_pairBit
public static final int e_centerOfMassBit
public static final int e_dynamicTreeBit
public static final int e_wireframeDrawingBit
protected int m_drawFlags
protected IViewportTransform viewportTransform
public DebugDraw()
public DebugDraw(IViewportTransform viewport)
public void setViewportTransform(IViewportTransform viewportTransform)
public void setFlags(int flags)
public int getFlags()
public void appendFlags(int flags)
public void clearFlags(int flags)
public void drawPolygon(Vec2[] vertices, int vertexCount, javafx.scene.paint.Color color)
drawSegment(Vec2, Vec2, Color) to draw each side of the polygon.vertices - vertexCount - color - public abstract void drawPoint(Vec2 argPoint, float argRadiusOnScreen, javafx.scene.paint.Color argColor)
public abstract void drawSolidPolygon(Vec2[] vertices, int vertexCount, javafx.scene.paint.Color color)
vertices - vertexCount - color - public abstract void drawCircle(Vec2 center, float radius, javafx.scene.paint.Color color)
center - radius - color - public void drawCircle(Vec2 center, float radius, Vec2 axis, javafx.scene.paint.Color color)
public abstract void drawSolidCircle(Vec2 center, float radius, Vec2 axis, javafx.scene.paint.Color color)
center - radius - axis - color - public abstract void drawSegment(Vec2 p1, Vec2 p2, javafx.scene.paint.Color color)
p1 - p2 - color - public abstract void drawTransform(Transform xf)
xf - public abstract void drawString(float x,
float y,
String s,
javafx.scene.paint.Color color)
x - y - s - color - public abstract void drawParticles(Vec2[] centers, float radius, ParticleColor[] colors, int count)
colors - can be nullpublic abstract void drawParticlesWireframe(Vec2[] centers, float radius, ParticleColor[] colors, int count)
colors - can be nullpublic void flush()
public IViewportTransform getViewportTranform()
public void setCamera(float x,
float y,
float scale)
getViewportTranform()x - y - scale - public void getScreenToWorldToOut(Vec2 argScreen, Vec2 argWorld)
argScreen - argWorld - public void getWorldToScreenToOut(Vec2 argWorld, Vec2 argScreen)
argWorld - argScreen - public void getWorldToScreenToOut(float worldX,
float worldY,
Vec2 argScreen)
worldX - worldY - argScreen - public Vec2 getWorldToScreen(Vec2 argWorld)
argWorld - public Vec2 getWorldToScreen(float worldX, float worldY)
worldX - worldY - public void getScreenToWorldToOut(float screenX,
float screenY,
Vec2 argWorld)
screenX - screenY - argWorld - public Vec2 getScreenToWorld(Vec2 argScreen)
argScreen - public Vec2 getScreenToWorld(float screenX, float screenY)
screenX - screenY - Copyright © 2017. All rights reserved.