Difference between revisions of "R3d.World.new"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
Line 4: Line 4:
 
=== Description ===
 
=== Description ===
 
Creates a new ReactPhysics3D dynamics world.
 
Creates a new ReactPhysics3D dynamics world.
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
r3d.World.new(gravityX, gravityY, gravityZ)
 
r3d.World.new(gravityX, gravityY, gravityZ)
 
</source>
 
</source>
Line 14: Line 14:
  
 
=== Example ===
 
=== Example ===
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
require "reactphysics3d"
 
require "reactphysics3d"
 
local world = r3d.World.new(0, -9.8, 0)
 
local world = r3d.World.new(0, -9.8, 0)

Revision as of 15:30, 13 July 2023

Available since: Gideros 2019.10
Class: R3d.World

Description

Creates a new ReactPhysics3D dynamics world. <syntaxhighlight lang="lua"> r3d.World.new(gravityX, gravityY, gravityZ) </source>

Parameters

gravityX: (number) the gravity on the X axis (m/s^2)
gravityY: (number) the gravity on the Y axis (m/s^2)
gravityZ: (number) the gravity on the Z axis (m/s^2)

Example

<syntaxhighlight lang="lua"> require "reactphysics3d" local world = r3d.World.new(0, -9.8, 0) </source>