The interface of debug drawer. This provides graphical information of a physics world for debugging softwares. Users should override at least three methods DebugDraw.point, DebugDraw.triangle, DebugDraw.line.

Constructor

new()

Default constructor.

Variables

drawAabbs:Bool

Whether to draw the AABBs.

drawBases:Bool

Whether to draw the bases of the rigid bodies.

drawBvh:Bool

Whether to draw the bounding volume hierarchy of the broad-phase collision detection. If BvhBroadPhase is not used, nothing will be drawn regardless of the value of this parameter.

drawBvhMaxLevel:Int

The maximum depth of the BVH to be drawn. If DebugDrawer.drawBvh is set to false, the entire BVH will not be drawn.

drawBvhMinLevel:Int

The minimum depth of the BVH to be drawn. If DebugDrawer.drawBvh is set to false, the entire BVH will not be drawn.

drawContactBases:Bool

Whether to draw the bases (normals, tangents, and binormals) of the contacts.

drawContacts:Bool

Whether to draw the contacts.

drawJointLimits:Bool

Whether to draw the limits of the joints.

drawJoints:Bool

Whether to draw the joints.

drawPairs:Bool

Whether to draw the overlapping pairs of the AABBs.

drawShapes:Bool

Whether to draw the shapes.

style:DebugDrawStyle

The rendering style of the debug draw.

wireframe:Bool

Whether the shapes are drawn in wireframe mode.

Methods

aabb(min:Vec3, max:Vec3, color:Vec3):Void

Draws an axis-aligned bounding box.

min is the minimum point of the AABB.

max is the maximum point of the AABB.

color is the color of the AABB.

arc(center:Vec3, ex:Vec3, ey:Vec3, radiusX:Float, radiusY:Float, startAngle:Float, endAngle:Float, drawSector:Bool, color:Vec3):Void

Draws an arc.

center is the center of the arc.

ex is the normalized x-axis vector of the arc.

ey is the normalized y-axis vector of the arc.

radiusX is the radius along the x-axis of the arc.

radiusY is the radius along the y-axis of the arc.

startAngle is the start angle of the arc in radians.

endAngle is the end angle of the arc in radians.

drawSector is whether to draw line segments between start/end point and center point.

color is the color of the arc.

basis(transform:Transform, length:Float, colorX:Vec3, colorY:Vec3, colorZ:Vec3):Void

Draws the basis of a transform transform.

length is the length of the lines to be drawn.

colorX is the color of the x-axis of the basis.

colorY is the color of the y-axis of the basis.

colorZ is the color of the z-axis of the basis.

box(tf:Transform, halfExtents:Vec3, color:Vec3):Void

Draws a box.

tf is the transformation of the box.

halfExtents is the half-extents of the box.

color is the color of the box.

capsule(tf:Transform, radius:Float, halfHeight:Float, color:Vec3):Void

Draws a capsule locally along to the y-axis.

tf is the transformation of the capsule.

radius is the radius of the capsule.

halfHeight is the half-height of the capsule.

color is the color of the capsule.

cone(tf:Transform, radius:Float, halfHeight:Float, color:Vec3):Void

Draws a cone locally along to the y-axis. The center of the cone is in the middle of the vertex and the center of the base circle.

tf is the transformation of the cone.

radius is the radius of the base circle of the cone.

halfHeight is the half-height of the cone. The local position of the vertex of the cone is (0, halfHeight, 0).

color is the color of the cone.

cylinder(tf:Transform, radius:Float, halfHeight:Float, color:Vec3):Void

Draws a cylinder locally along to the y-axis.

tf is the transformation of the cylinder.

radius is the radius of the cylinder.

halfHeight is the half-height of the cylinder.

color is the color of the cylinder.

ellipse(center:Vec3, ex:Vec3, ey:Vec3, radiusX:Float, radiusY:Float, color:Vec3):Void

Draws an ellipse.

center is the center of the ellipse.

ex is the normalized x-axis vector of the ellipse.

ey is the normalized y-axis vector of the ellipse.

radiusX is the radius along the x-axis of the ellipse.

radiusY is the radius along the y-axis of the ellipse.

color is the color of the ellipse.

line(v1:Vec3, v2:Vec3, color:Vec3):Void

Draws a line segment between v1 and v2.

color is the color of the line segment.

point(v:Vec3, color:Vec3):Void

Draws a point at v.

color is the color of the point.

rect(v1:Vec3, v2:Vec3, v3:Vec3, v4:Vec3, n1:Vec3, n2:Vec3, n3:Vec3, n4:Vec3, color:Vec3):Void

Draws a rectangle.

v1, v2, v3, v4 are the rectangle's vertices in CCW order.

n1, n2, n3, n4 are the normals of the rectangle's vertices in CCW order.

color is the color of the rectangle.

sphere(tf:Transform, radius:Float, color:Vec3):Void

Draws a sphere.

tf is the transformation of the sphere.

radius is the radius of the sphere.

color is the color of the sphere.

triangle(v1:Vec3, v2:Vec3, v3:Vec3, n1:Vec3, n2:Vec3, n3:Vec3, color:Vec3):Void

Draws a triangle.

v1, v2, v3 are the triangle's vertices in CCW order.

n1, n2, n3 are the normals of the triangle's vertices in CCW order.

color is the color of the triangle.