Difference between revisions of "R3d.DebugDraw"
From GiderosMobile
(Created page with "__NOTOC__ <!-- GIDEROSOBJ:r3d.DebugDraw --> '''Supported platforms:''' File:Platform android.pngFile:Platform ios.pngFile:Platform mac.pngFile:Platform pc.png[...") |
m (Text replacement - "<source" to "<syntaxhighlight") |
||
Line 10: | Line 10: | ||
=== Example === | === Example === | ||
− | < | + | <syntaxhighlight lang="lua"> |
function LevelX:init() | function LevelX:init() | ||
-- r3d world | -- r3d world |
Revision as of 14:30, 13 July 2023
Supported platforms:
Available since: Gideros 2020.11
Description
The r3d.DebugDraw class is used to provide debug drawing of physical entities in your application.
You should disable DebugDraw for the final release because this can be quite expensive to compute
Example
<syntaxhighlight lang="lua"> function LevelX:init() -- r3d world self.world = r3d.World.new(0, -9.8, 0) -- gravity -- debug draw local debugDraw = r3d.DebugDraw.new(self.world) --Set up a fullscreen 3D viewport self.view = D3.View.new(myappwidth, myappheight, 45, 0.1, 1024) self:addChild(self.view) -- the scene self.scene = self.view:getScene() -- a player self.player1 = Player1.new(self.world) -- add objects, player1, ... to the scene self.scene:addChild(self.player1) self.scene:addChild(debugDraw) end </source>
Methodsr3d.DebugDraw.new creates a DebugDraw instance |
Constants |