| Package | nape.util |
| Class | Debug |
| Subclasses | ShapeDebug, BitmapDebug |
Superclass for nape debug drawers.
Public Properties
| Property | Defined By | |
|
display : flash.display.DisplayObject Debug graphic |
Debug | |
|
bgColor : Int Debug background colour |
Debug | |
|
transform : Mat23 Debug draw transform |
Debug | |
|
drawCollisionArbiters : Bool = false Draw collision information |
Debug | |
|
drawFluidArbiters : Bool = false Draw fluid interaction information |
Debug | |
|
drawSensorArbiters : Bool = false Draw sensor information |
Debug | |
|
drawBodies : Bool = true Draw bodies |
Debug | |
|
drawShapeDetail : Bool = false Draw shape detailed information |
Debug | |
|
drawBodyDetail : Bool = false Draw body detailed information |
Debug | |
|
drawConstraints : Bool = false Draw constraints |
Debug | |
|
drawConstraintSprings : Bool = true Draw constraint springs |
Debug | |
|
drawConstraintErrors : Bool = false Draw constraint errors |
Debug | |
|
cullingEnabled : Bool = false Perform object culling |
Debug | |
|
colour : Int->Int = null Colour tuning |
Debug |
Public Methods
| Method | Defined By | |
|
clear() Clear debug drawer |
Debug | |
|
draw(object:const Dynamic) Draw nape object |
Debug | |
|
flush() Update debug graphic |
Debug | |
|
|
||
|
drawAABB(aabb:const AABB, colour:Int) Draw an AABB to display |
Debug | |
|
drawCircle(position:const Vec2, radius:Float, colour:Int) Draw a Circle to display |
Debug | |
|
drawLine(start:const Vec2, end:const Vec2, colour:Int) Draw a line to display |
Debug | |
|
drawFilledCircle(position:const Vec2, radius:Float, colour:Int) Draw a Circle to display |
Debug | |
|
drawFilledTriangle(p0:const Vec2, p1:const Vec2, p2:const Vec2, colour:Int) Draw a triangle to display |
Debug | |
|
drawPolygon(polygon:const CompatiblePolygon, colour:Int) Draw a polygon to display |
Debug | |
|
drawFilledPolygon(polygon:const CompatiblePolygon, colour:Int) Draw a filled polygon to display |
Debug |
Public Static Methods
| Method | Defined By | |
|
static
createGraphic(body:const Body) : flash.display.DisplayObject Create debug graphic for Body |
Debug | |
|
|
||
|
static
version() : String Get build version of library. |
Debug | |
|
static
clearObjectPools() Clear out all public and private internal pools |
Debug |
Property Detail
| display | property |
property display : flash.display.DisplayObjectDisplay object to which debug operations are rendered
| bgColor | property |
|
property bgColor : IntDepending on specific Debug type the backgruodn colour may be more or less important. In the very least it helps to choose better colours when drawing faded objects such as sleeping bodies
| transform | property |
|
property transform : Mat23Transformation to be applied to all debug draw operations. When equal to the identity transform a faster drawing path is used in the internal routines.
| drawCollisionArbiters | property |
|
property drawCollisionArbiters : BoolIf true, contact positions will be drawn.
| drawFluidArbiters | property |
|
property drawFluidArbiters : BoolIf true, the position relating to the geometric centre of shape overlaps in fluid interactions will be drawn.
| drawSensorArbiters | property |
|
property drawSensorArbiters : BoolIf true, the position relating to the geometric centre of shape overlaps in fluid interactions will be drawn.
| drawBodies | property |
|
property drawBodies : BoolIf true, bodies will be drawn.
| drawShapeDetail | property |
|
property drawShapeDetail : BoolIf true, Shape bounds and centre of mass will be drawn.
| drawBodyDetail | property |
|
property drawBodyDetail : BoolIf true, Body bounds, origin and centre of mass will be drawn.
| drawConstraints | property |
|
property drawConstraints : BoolIf true, constraints will be drawn.
| drawConstraintSprings | property |
|
property drawConstraintSprings : BoolIf true (and constraints are drawn), then springs representing positional errors will be drawn for soft constraints
| drawConstraintErrors | property |
|
property drawConstraintErrors : BoolIf true (and constraints are drawn), then representation of positional errors will be drawn for stiff constraints
| cullingEnabled | property |
|
property cullingEnabled : BoolFor the moment is not general purpose. However when calling Debug::draw() with a Space object, then only those shapes/bodies inside of the viewport defined by the transform and the width/height of the debug display will be drawn
| colour | property |
|
property colour : Int->IntOptional function to be used to decide what colour shapes are to be drawn with (also what colour things like body bounding boxes should have). The input is the id of the shape/body/whatever and the output should be an RGB value
Method Detail
| clear | method |
function clear()Clear debug graphics
| draw | method |
|
function draw(object:const Dynamic)Draw nape object to debug graphic.
object must be of type Body,Shape,Space,Arbiter,Contact,Constraint or derivative
For the time being, only objects in a space, and shapes in a body in a space will be drawn.
Error if:
object is not a drawable type| flush | method |
|
function flush()Commit any pending draw operations to the debug's graphic. For ShapeDebug this operation does nothing as any draw operations are committed immediately
| drawAABB | method |
|
function drawAABB(aabb:const AABB, colour:Int)Draw the outline of the given AABB to the debug display
| drawCircle | method |
|
function drawCircle(position:const Vec2, radius:Float, colour:Int)Draw the outline of a circle to the debug display
| drawLine | method |
|
function drawLine(start:const Vec2, end:const Vec2, colour:Int)Draw a line to the debug display
| drawFilledCircle | method |
|
function drawFilledCircle(position:const Vec2, radius:Float, colour:Int)Draw a filled circle to the debug display
| drawFilledTriangle | method |
|
function drawFilledTriangle(p0:const Vec2, p1:const Vec2, p2:const Vec2, colour:Int)Draw a filled triangle to the debug display
| drawPolygon | method |
|
function drawPolygon(polygon:const CompatiblePolygon, colour:Int)Draw a polygon to the display as a set of line segments with given colour
| drawFilledPolygon | method |
|
function drawFilledPolygon(polygon:const CompatiblePolygon, colour:Int)Draw a filled polygon to the display. For ShapeDebug native operations are used, for BitmapDebug the geometric utilities of GeomPoly are used to perform a possible simple and convex decomposition on the input polygon first.
Static Method Detail
| createGraphic | static | method |
static function createGraphic(body:const Body) : flash.display.DisplayObjectFor flash9+ only, create a debug graphic for use with assigning to the body's graphic property.
Error if:
body == null| version | static | method |
|
static function version() : StringFrom Milestone 5.2 onwards, added this method to be able to programaticaly determine what build someone is using ^^.
| clearObjectPools | static | method |
|
static function clearObjectPools()Should not have any general use. Kinda pointless to clear pools that are there for re-use; however may be helpful for tracking any memory leak style bugs
