LiquidFun: Difference between revisions

From GiderosMobile
No edit summary
m Text replacement - "<source" to "<syntaxhighlight"
Line 8: Line 8:


To add LiquidFun physics engine to your application you call:
To add LiquidFun physics engine to your application you call:
<source lang="lua">
<syntaxhighlight lang="lua">
require "liquidfun"
require "liquidfun"
</source>
</source>

Revision as of 13:28, 13 July 2023

Supported platforms:
Available since: Gideros 2011.6

Description

LiquidFun physics engine, is a 2D rigid-body and fluid simulation C++ engine based on Box2D. The fluid simulation was implemented by Google http://google.github.io/liquidfun/Programmers-Guide/html/index.html.

To add LiquidFun physics engine to your application you call: <syntaxhighlight lang="lua"> require "liquidfun" </source>

Basically you:

  1. create the 2d world => B2.World.new
  2. debug drawing (recommanded for testing) => B2.DebugDraw
  3. create your body => B2.World
  4. define the shape of your body => example: a sphere B2.CircleShape
  5. add the fixture => B2.Body:createFixture
  6. add joints (optional) => B2.World:createJoint
  7. HAVE FUN!

Classes