APIdia Launch Partner
Top Fields Constructors Methods
com.badlogic.gdx.physics.bullet

public Class DebugDrawer

extends btIDebugDraw
implements Disposable
Class Inheritance
All Implemented Interfaces
com.badlogic.gdx.utils.Disposable
Imports
com.badlogic.gdx.Gdx, com.badlogic.gdx.graphics.Camera, com.badlogic.gdx.graphics.g2d.BitmapFont, .SpriteBatch, com.badlogic.gdx.graphics.glutils.ShapeRenderer, .ShapeRenderer.ShapeType, com.badlogic.gdx.math.Vector3, com.badlogic.gdx.physics.bullet.linearmath.btIDebugDraw, com.badlogic.gdx.utils.Align, .Disposable, com.badlogic.gdx.utils.viewport.Viewport

Author
xoppa

Field Summary

Modifier and TypeField and Description
private Camera
private int
private BitmapFont
private boolean
private boolean
private boolean
private ShapeRenderer
private SpriteBatch
private Viewport

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
begin(Camera
The (perspective) camera to be used when doing the debug rendering.
camera
)

Use this in case no glViewport is in use.

public void
begin(Viewport
The currently used viewport with its managed (perspective) camera.
viewport
)

This has to be used in case the camera to be used is managed via a Viewport.

public void
dispose()

Overrides com.badlogic.gdx.physics.bullet.BulletBase.dispose.

Implements com.badlogic.gdx.utils.Disposable.dispose.

Releases all resources of this object.

public void
public void
drawContactPoint(Vector3 pointOnB, Vector3 normalOnB, float distance, int lifeTime, Vector3 color)

Overrides com.badlogic.gdx.physics.bullet.linearmath.btIDebugDraw.drawContactPoint.

public void
public void
public void
end()

Ends the debug rendering process and leads to a flush.

public int
public BitmapFont
public ShapeRenderer
public SpriteBatch
public void
public void
public void
setFont(BitmapFont font)

Switches the BitmapFont.

public void
setShapeRenderer(ShapeRenderer shapeRenderer)

Switches the ShapeRenderer.

public void
setSpriteBatch(SpriteBatch spriteBatch)

Switches the SpriteBatch.

Inherited from com.badlogic.gdx.physics.bullet.linearmath.btIDebugDraw:
clearLinesdeletedrawAabbdrawArcdrawArcdrawBoxdrawBoxdrawCapsuledrawConedrawCylinderdrawLinedrawPlanedrawSpheredrawSpheredrawSpherePatchdrawSpherePatchdrawSpherePatchdrawTransformdrawTrianglefinalizeflushLinesgetCPtrgetDefaultColorsresetsetDefaultColorsswigDirectorDisconnectswigReleaseOwnershipswigTakeOwnership

Field Detail

cameraback to summary
private Camera camera
debugModeback to summary
private int debugMode
fontback to summary
private BitmapFont font
ownsFontback to summary
private boolean ownsFont
ownsShapeRendererback to summary
private boolean ownsShapeRenderer
ownsSpriteBatchback to summary
private boolean ownsSpriteBatch
shapeRendererback to summary
private ShapeRenderer shapeRenderer
spriteBatchback to summary
private SpriteBatch spriteBatch
viewportback to summary
private Viewport viewport

Constructor Detail

DebugDrawerback to summary
public DebugDrawer()

Method Detail

beginback to summary
public void begin(Camera camera)

Use this in case no glViewport is in use. Otherwise please supply the used Viewport to begin(Viewport).

Parameters
camera:Camera

The (perspective) camera to be used when doing the debug rendering.

beginback to summary
public void begin(Viewport viewport)

This has to be used in case the camera to be used is managed via a Viewport.

Parameters
viewport:Viewport

The currently used viewport with its managed (perspective) camera.

disposeback to summary
public void dispose()

Overrides com.badlogic.gdx.physics.bullet.BulletBase.dispose.

Implements com.badlogic.gdx.utils.Disposable.dispose.

Doc from com.badlogic.gdx.utils.Disposable.dispose.

Releases all resources of this object.

Annotations
@Override
draw3dTextback to summary
public void draw3dText(Vector3 location, String textString)

Overrides com.badlogic.gdx.physics.bullet.linearmath.btIDebugDraw.draw3dText.

Annotations
@Override
drawContactPointback to summary
public void drawContactPoint(Vector3 pointOnB, Vector3 normalOnB, float distance, int lifeTime, Vector3 color)

Overrides com.badlogic.gdx.physics.bullet.linearmath.btIDebugDraw.drawContactPoint.

Annotations
@Override
drawLineback to summary
public void drawLine(Vector3 from, Vector3 to, Vector3 color)

Overrides com.badlogic.gdx.physics.bullet.linearmath.btIDebugDraw.drawLine.

Annotations
@Override
drawTriangleback to summary
public void drawTriangle(Vector3 v0, Vector3 v1, Vector3 v2, Vector3 color, float arg4)

Overrides com.badlogic.gdx.physics.bullet.linearmath.btIDebugDraw.drawTriangle.

Annotations
@Override
endback to summary
public void end()

Ends the debug rendering process and leads to a flush.

getDebugModeback to summary
public int getDebugMode()

Overrides com.badlogic.gdx.physics.bullet.linearmath.btIDebugDraw.getDebugMode.

Annotations
@Override
getFontback to summary
public BitmapFont getFont()
getShapeRendererback to summary
public ShapeRenderer getShapeRenderer()
getSpriteBatchback to summary
public SpriteBatch getSpriteBatch()
reportErrorWarningback to summary
public void reportErrorWarning(String warningString)

Overrides com.badlogic.gdx.physics.bullet.linearmath.btIDebugDraw.reportErrorWarning.

Annotations
@Override
setDebugModeback to summary
public void setDebugMode(int debugMode)

Overrides com.badlogic.gdx.physics.bullet.linearmath.btIDebugDraw.setDebugMode.

Annotations
@Override
setFontback to summary
public void setFont(BitmapFont font)

Switches the BitmapFont. The given font won't be disposed when dispose() is called.

setShapeRendererback to summary
public void setShapeRenderer(ShapeRenderer shapeRenderer)

Switches the ShapeRenderer. The given shape renderer won't be disposed when dispose() is called.

setSpriteBatchback to summary
public void setSpriteBatch(SpriteBatch spriteBatch)

Switches the SpriteBatch. The given sprite batch won't be disposed when dispose() is called.