Difference between revisions of "R3d.DebugDraw"
From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight") |
m (Text replacement - "</source>" to "</syntaxhighlight>") |
||
Line 27: | Line 27: | ||
self.scene:addChild(debugDraw) | self.scene:addChild(debugDraw) | ||
end | end | ||
− | </ | + | </syntaxhighlight> |
{|- | {|- |
Latest revision as of 14:31, 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
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
Methodsr3d.DebugDraw.new creates a DebugDraw instance |
Constants |