Debugging-Functions

class DebugDrawer

class DebugDrawer : SimObject
drawBox(Point3F a, Point3F b, ColorF color)

Draws a Box in the 3D-World.

  • Point3F a: point of the first corner
  • Point3F b point of the opposite corner
  • ColorF color color of the box

Example You should run this every frame

local point1 = Point3F(-124.8, 142.5, 465.3) --The first point
local point2 = Point3F(4,6,3) -- The second point
local color = ColorF(1,1,1,1) --The Color-Element
debugDrawer:drawBox(point1, point2, color)
drawSquarePrism(Point3F base, Point3F tip, Point2F baseSize, Point2F tipSize, ColorF color)
  • Point3F base:
  • Point3F tip:
  • Point3F baseSize:
  • Point3F tipSize:
  • ColorF color: Color of the Square Prism

Example: You should run this every frame

debugDrawer:drawSquarePrism(Point3F(-124.8, 142.5, 465.3), Point3F(4,6,3), Point2F(5,5), Point2F(5, 5), ColorF(1,1,1,1))
drawLine(Point3F a, Point3F b, ColorF color)

Draws a Line between 2 Points

  • Point3F a: First point, where the line starts
  • Point3F b: Second point, where the line ends
  • ColorF color color of the Line

Example: You should run this every frame

local point1 = Point3F(-124.8, 142.5, 465.3) --The first point
local point2 = Point3F(4,6,3) -- The second point
local color = ColorF(1,1,1,1) --The Color-Element
debugDrawer:drawLine(point1, point2, color)
drawTri(Point3F a, Point3F b, Point3F c, ColorF color)

draws a triangle in the 3D-World

  • Point3F a: First point, where the Tri starts
  • Point3F b: Second point, where the tri goes to
  • Point3F c: third point, Tri goes to
  • ColorF color color of the Line

Example You should run this every frame

local point1 = Point3F(-124.8, 142.5, 465.3)
local point2 = Point3F(4,6,3)
local point3 = Point3F(100, 100, 100)
local color = ColorF(1,1,1,1)
debugDrawer:drawTri(point1, point2, point3, color)
drawText(Point3F pos, BString str, ColorF color)

Draws a text to a 3D-Position in the world

  • Point3F pos: First point, where the Tri starts
  • string str: The text to be drawn
  • ColorF color color of the Line

Example You should run this every frame

local point1 = Point3F(-124.8, 142.5, 465.3)
local color = ColorF(1,1,1,1)
debugDrawer:drawText(point1, "Hello world", color)
drawTextAdvanced(Point3F pos, BString text, ColorF color, bool useAdvancedText, bool twod, ColorI bgColor)
  • Point3F pos: Point where the text should be drawn
  • BString text: The text to be drawn
  • ColorF color color of the Line
  • bool useAdvancedText: true if you want to use the advanced Text
  • bool twod: special 2d/3d drawing mode with that
  • ColorI bgColor background-color of the Line

Example: You should run this every frame


drawCylinder(Point3F a, Point3F b, F32 radius, ColorF color)
  • Point3F a: First point, where the Cylinder starts
  • Point3F b: Second point, where the Cylinder goes to
  • float radius:
  • ColorF color: color of the Cylinder

Example


drawSphere(Point3F a, float radius, ColorF color)
  • Point3F a: The point, where the middle of the Sphere is
  • float radius: The radius of the Sphere
  • ColorF color: color of the Sphere

Example


setLastTTL(int ms)

How long should this primitive be draw for, 0 = one frame, DD_INFINITE = draw forever

Parameters:

  • int ms: Time in ms
setLastZTest(bool enable)

Disable/enable z testing on the last primitive.

  • bool enable:

Primitives default to z testing on.

class LuaLogSink
LogSink()

constructor

open(char filename, whitelist = "", blacklist = "")
close()