Difference between revisions of "ReactPhysics3D"

From GiderosMobile
m (Text replacement - "</source>" to "</syntaxhighlight>")
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
<!-- GIDEROSOBJ:ReactPhysics3D-->
 
<!-- GIDEROSOBJ:ReactPhysics3D-->
'''<translate>Supported platforms</translate>:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]][[File:Platform html5.png]][[File:Platform winrt.png]][[File:Platform win32.png]]<br/>
+
'''Supported platforms:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]][[File:Platform html5.png]][[File:Platform winrt.png]][[File:Platform win32.png]]<br/>
'''<translate>Available since</translate>:''' Gideros 2019.10<br/>
+
'''Available since:''' Gideros 2019.10<br/>
  
 
=== Description ===
 
=== Description ===
 
ReactPhysics3D is an open source 3D physics and collision engine [[https://www.reactphysics3d.com/ React Physics 3D home page]].
 
ReactPhysics3D is an open source 3D physics and collision engine [[https://www.reactphysics3d.com/ React Physics 3D home page]].
 +
 +
To add '''ReactPhysics3D engine''' to your application you call:
 +
<syntaxhighlight lang="lua">
 +
require "reactphysics3d"
 +
</syntaxhighlight>
  
 
Basically you:
 
Basically you:
# create the 3d world
+
# '''create the 3d world''' => [[r3d.World.new]]
# create your body
+
# '''add the 3d world DebugDraw (recommended for testing)''' => [[r3d.DebugDraw.new]]
# define the shape of your body
+
# '''create your body''' => [[r3d.World:createBody]]
# add the fixture
+
# '''define the shape of your body''' => example: a sphere [[r3d.SphereShape.new]]
# add joints (optional)
+
# '''add the fixture''' => [[r3d.Body:createFixture]]'''
 +
# '''add joints (optional)''' => example: a fixed joint [[r3d.World:createFixedJoint]]
 +
# ''' HAVE FUN! '''
  
 
=== Classes ===
 
=== Classes ===
 
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
 
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
[[Special:MyLanguage/r3d.Body|r3d.Body]]<br/>
+
[[r3d.Body]]<br/><!--GIDEROSOBJ:r3d.Body-->
<!-- GIDEROSOBJ:r3d.Body -->
+
[[r3d.DebugDraw]]<br/><!--GIDEROSOBJ:r3d.DebugDraw-->
[[Special:MyLanguage/r3d.Fixture|r3d.Fixture]]<br/>
+
[[r3d.Fixture]]<br/><!--GIDEROSOBJ:r3d.Fixture-->
<!-- GIDEROSOBJ:r3d.Fixture -->
+
[[r3d.Joint]]<br/><!--GIDEROSOBJ:r3d.Joint-->
[[Special:MyLanguage/r3d.Joint|r3d.Joint]]<br/>
+
<!--[[r3d.FixedJoint]]<br/>--><!--GIDEROSOBJ:r3d.FixedJoint-->
<!-- GIDEROSOBJ:r3d.Joint -->
+
<!--[[r3d.HingeJoint]]<br/>--><!--GIDEROSOBJ:r3d.HingeJoint-->
<!--[[Special:MyLanguage/r3d.FixedJoint|r3d.FixedJoint]]<br/>-->
+
[[r3d.Shape]]<br/><!--GIDEROSOBJ:r3d.Shape-->
<!-- GIDEROSOBJ:r3d.FixedJoint -->
+
<!--[[r3d.BallAndSocketShape]]<br/>--><!--GIDEROSOBJ:r3d.BallAndSocketShape-->
<!--[[Special:MyLanguage/r3d.HingeJoint|r3d.HingeJoint]]<br/>-->
+
<!--[[r3d.BoxShape]]<br/>--><!--GIDEROSOBJ:r3d.BoxShape-->
<!-- GIDEROSOBJ:r3d.HingeJoint -->
+
<!--[[r3d.CapsuleShape]]<br/>--><!--GIDEROSOBJ:r3d.CapsuleShape-->
[[Special:MyLanguage/r3d.Shape|r3d.Shape]]<br/>
+
<!--[[r3d.ConcaveMeshShape]]<br/>--><!--GIDEROSOBJ:r3d.ConcaveMeshShape-->
<!-- GIDEROSOBJ:r3d.Shape -->
+
<!--[[r3d.ConvexMeshShape]]<br/>--><!--GIDEROSOBJ:r3d.ConvexMeshShape-->
<!--[[Special:MyLanguage/r3d.BallAndSocketShape|r3d.BallAndSocketShape]]<br/>-->
+
<!--[[r3d.HeightFieldShape]]<br/>--><!--GIDEROSOBJ:r3d.HeightFieldShape-->
<!-- GIDEROSOBJ:r3d.BallAndSocketShape -->
+
<!--[[r3d.SphereShape]]<br/>--><!--GIDEROSOBJ:r3d.SphereShape-->
<!--[[Special:MyLanguage/r3d.BoxShape|r3d.BoxShape]]<br/>-->
+
[[r3d.World]]<br /><!--GIDEROSOBJ:r3d.World-->
<!-- GIDEROSOBJ:r3d.BoxShape -->
 
<!--[[Special:MyLanguage/r3d.CapsuleShape|r3d.CapsuleShape]]<br/>-->
 
<!-- GIDEROSOBJ:r3d.CapsuleShape -->
 
<!--[[Special:MyLanguage/r3d.ConcaveMeshShape|r3d.ConcaveMeshShape]]<br/>-->
 
<!-- GIDEROSOBJ:r3d.ConcaveMeshShape -->
 
<!--[[Special:MyLanguage/r3d.ConvexMeshShape|r3d.ConvexMeshShape]]<br/>-->
 
<!-- GIDEROSOBJ:r3d.ConvexMeshShape -->
 
<!--[[Special:MyLanguage/r3d.HeightFieldShape|r3d.HeightFieldShape]]<br/>-->
 
<!-- GIDEROSOBJ:r3d.HeightFieldShape -->
 
<!--[[Special:MyLanguage/r3d.SphereShape|r3d.SphereShape]]<br/>-->
 
<!-- GIDEROSOBJ:r3d.SphereShape -->
 
[[Special:MyLanguage/r3d.World|r3d.World]]<br />
 
<!-- GIDEROSOBJ:r3d.World -->
 
 
</div>
 
</div>
  
 
{{GIDEROS IMPORTANT LINKS}}
 
{{GIDEROS IMPORTANT LINKS}}

Latest revision as of 15:32, 13 July 2023

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