ReactPhysics3D: Difference between revisions

From GiderosMobile
m Text replacement - "<source" to "<syntaxhighlight"
m Text replacement - "</source>" to "</syntaxhighlight>"
Line 10: Line 10:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
require "reactphysics3d"
require "reactphysics3d"
</source>
</syntaxhighlight>


Basically you:
Basically you:

Revision as of 13:32, 13 July 2023

Supported platforms:
Available since: Gideros 2019.10

Description

ReactPhysics3D is an open source 3D physics and collision engine [React Physics 3D home page].

To add ReactPhysics3D engine to your application you call:

require "reactphysics3d"

Basically you:

  1. create the 3d world => r3d.World.new
  2. add the 3d world DebugDraw (recommended for testing) => r3d.DebugDraw.new
  3. create your body => r3d.World:createBody
  4. define the shape of your body => example: a sphere r3d.SphereShape.new
  5. add the fixture => r3d.Body:createFixture
  6. add joints (optional) => example: a fixed joint r3d.World:createFixedJoint
  7. HAVE FUN!

Classes