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>")
 
(One intermediate revision by the same user not shown)
Line 10: Line 10:
  
 
=== Example ===
 
=== Example ===
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
function LevelX:init()
 
function LevelX:init()
 
-- r3d world
 
-- r3d world
Line 27: Line 27:
 
self.scene:addChild(debugDraw)
 
self.scene:addChild(debugDraw)
 
end
 
end
</source>
+
</syntaxhighlight>
  
 
{|-
 
{|-

Latest revision as of 15:31, 13 July 2023

Supported platforms: Platform android.pngPlatform ios.pngPlatform mac.pngPlatform pc.pngPlatform html5.pngPlatform winrt.pngPlatform win32.png
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

Methods

r3d.DebugDraw.new creates a DebugDraw instance

Constants


ReactPhysics3D