Difference between revisions of "B2"

From GiderosMobile
 
(19 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
'''Supported platforms:''' android, ios, mac, pc<br/>
+
<!-- GIDEROSOBJ:b2 -->
 +
'''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/>
 
'''Available since:''' Gideros 2011.6<br/>
 
'''Available since:''' Gideros 2011.6<br/>
 +
 
=== Description ===
 
=== Description ===
<br />
+
To load the Box2D library, call ''require &quot;box2d&quot;''. After loading Box2D library, [[Special:MyLanguage/b2|b2]] table stores all classes and functions related to Box2D physics library.
To load the Box2D library, call `require &quot;box2d&quot;`. After loading Box2D library, `b2` table stores all <br />
 
classes and functions related to Box2D physics library. <br />
 
<br />
 
  
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
{|-
 
{|-
| style="width: 50%;"|
+
| style="width: 50%; vertical-align:top;"|
 
=== Methods ===
 
=== Methods ===
[[b2.createDistanceJointDef]] - creates and returns a distance joint definition table<br/>
+
[[b2.createDistanceJointDef]] ''creates and returns a distance joint definition table''<br/><!--GIDEROSMTD:b2.createDistanceJointDef(bodyA,bodyB,anchorAx,anchorAy,anchorBx,anchorBy) creates and returns a distance joint definition table-->
[[b2.createFrictionJointDef]] - creates and returns a friction joint definition table<br/>
+
[[b2.createFrictionJointDef]] ''creates and returns a friction joint definition table''<br/><!--GIDEROSMTD:b2.createFrictionJointDef(bodyA,bodyB,anchorx,anchory) creates and returns a friction joint definition table-->
[[b2.createGearJointDef]] - creates and returns a gear joint definition table<br/>
+
[[b2.createGearJointDef]] ''creates and returns a gear joint definition table''<br/><!--GIDEROSMTD:b2.createGearJointDef(bodyA,bodyB,joint1,joint2,ratio) creates and returns a gear joint definition table-->
[[b2.createMouseJointDef]] - creates and returns a mouse joint definition table<br/>
+
[[b2.createMouseJointDef]] ''creates and returns a mouse joint definition table''<br/><!--GIDEROSMTD:b2.createMouseJointDef(bodyA,bodyB,targetx,targety,maxForce,frequencyHz,dampingRatio) creates and returns a mouse joint definition table-->
[[b2.createPrismaticJointDef]] - creates and returns a prismatic joint definition table<br/>
+
[[b2.createPrismaticJointDef]] ''creates and returns a prismatic joint definition table''<br/><!--GIDEROSMTD:b2.createPrismaticJointDef(bodyA,bodyB,anchorx,anchory,axisx,axisy) creates and returns a prismatic joint definition table-->
[[b2.createPulleyJointDef]] - creates and returns a pulley joint definition table<br/>
+
[[b2.createPulleyJointDef]] ''creates and returns a pulley joint definition table''<br/><!--GIDEROSMTD:b2.createPulleyJointDef(bodyA,bodyB,groundAnchorAx,groundAnchorAy,groundAnchorBx,groundAnchorBy,anchorAx,anchorAy,anchorBx,anchorBy,ratio) creates and returns a pulley joint definition table-->
[[b2.createRevoluteJointDef]] - creates and returns a revolute joint definition table<br/>
+
[[b2.createRevoluteJointDef]] ''creates and returns a revolute joint definition table''<br/><!--GIDEROSMTD:b2.createRevoluteJointDef(bodyA,bodyB,anchorx,anchory) creates and returns a revolute joint definition table-->
[[b2.createRopeJointDef]] - <br/>
+
[[b2.createRopeJointDef]] ''creates and returns a rope joint definition table''<br/><!--GIDEROSMTD:b2.createRopeJointDef(bodyA,bodyB,anchorAx,anchorAy,anchorBx,anchorBy,maxLength) creates and returns a rope joint definition table-->
[[b2.createWeldJointDef]] - creates and returns a weld joint definition table<br/>
+
[[b2.createWeldJointDef]] ''creates and returns a weld joint definition table''<br/><!--GIDEROSMTD:b2.createWeldJointDef(bodyA,bodyB,anchorAx,anchorAy,anchorBx,anchorBy) creates and returns a weld joint definition table-->
[[b2.createWheelJointDef]] - creates and returns a wheel joint definition table<br/>
+
[[b2.createWheelJointDef]] ''creates and returns a wheel joint definition table''<br/><!--GIDEROSMTD:b2.createWheelJointDef(bodyA,bodyB,anchorx,anchory,axisx,axisy) creates and returns a wheel joint definition table-->
[[b2.getScale]] - returns the global pixels to meters scale<br/>
+
[[b2.getScale]] ''returns the global pixels to meters scale''<br/><!--GIDEROSMTD:b2.getScale() returns the global pixels to meters scale-->
[[b2.setScale]] - sets the global pixels to meters scale<br/>
+
[[b2.setScale]] ''sets the global pixels to meters scale''<br/><!--GIDEROSMTD:b2.setScale(scale) sets the global pixels to meters scale-->
| style="width: 50%;"|
+
 
 +
| style="width: 50%; vertical-align:top;"|
 +
 
 
=== Events ===
 
=== Events ===
 
=== Constants ===
 
=== Constants ===
[[b2.DISTANCE_JOINT]]
+
[[b2.DISTANCE_JOINT]]<br/><!--GIDEROSCST:b2.DISTANCE_JOINT 3-->
[[b2.DYNAMIC_BODY]]
+
[[b2.DYNAMIC_BODY]]<br/><!--GIDEROSCST:b2.DYNAMIC_BODY 2-->
[[b2.FRICTION_JOINT]]
+
[[b2.FRICTION_JOINT]]<br/><!--GIDEROSCST:b2.FRICTION_JOINT 9-->
[[b2.GEAR_JOINT]]
+
[[b2.GEAR_JOINT]]<br/><!--GIDEROSCST:b2.GEAR_JOINT 6-->
[[b2.KINEMATIC_BODY]]
+
[[b2.KINEMATIC_BODY]]<br/><!--GIDEROSCST:b2.KINEMATIC_BODY 1-->
[[b2.MOUSE_JOINT]]
+
[[b2.MOUSE_JOINT]]<br/><!--GIDEROSCST:b2.MOUSE_JOINT 5-->
[[b2.PRISMATIC_JOINT]]
+
[[b2.PRISMATIC_JOINT]]<br/><!--GIDEROSCST:b2.PRISMATIC_JOINT 2-->
[[b2.PULLEY_JOINT]]
+
[[b2.PULLEY_JOINT]]<br/><!--GIDEROSCST:b2.PULLEY_JOINT 4-->
[[b2.REVOLUTE_JOINT]]
+
[[b2.REVOLUTE_JOINT]]<br/><!--GIDEROSCST:b2.REVOLUTE_JOINT 1-->
[[b2.ROPE_JOINT]]
+
[[b2.ROPE_JOINT]]<br/><!--GIDEROSCST:b2.ROPE_JOINT 10-->
[[b2.STATIC_BODY]]
+
[[b2.STATIC_BODY]]<br/><!--GIDEROSCST:b2.STATIC_BODY 0-->
[[b2.WELD_JOINT]]
+
[[b2.WELD_JOINT]]<br/><!--GIDEROSCST:b2.WELD_JOINT 8-->
[[b2.WHEEL_JOINT]]
+
[[b2.WHEEL_JOINT]]<br/><!--GIDEROSCST:b2.WHEEL_JOINT 7-->
 
|}
 
|}
 +
 +
----
 +
*'''[[LiquidFun]]'''

Latest revision as of 01:36, 1 December 2023

Supported platforms: Platform android.pngPlatform ios.pngPlatform mac.pngPlatform pc.pngPlatform html5.pngPlatform winrt.pngPlatform win32.png
Available since: Gideros 2011.6

Description

To load the Box2D library, call require "box2d". After loading Box2D library, b2 table stores all classes and functions related to Box2D physics library.

Methods

b2.createDistanceJointDef creates and returns a distance joint definition table
b2.createFrictionJointDef creates and returns a friction joint definition table
b2.createGearJointDef creates and returns a gear joint definition table
b2.createMouseJointDef creates and returns a mouse joint definition table
b2.createPrismaticJointDef creates and returns a prismatic joint definition table
b2.createPulleyJointDef creates and returns a pulley joint definition table
b2.createRevoluteJointDef creates and returns a revolute joint definition table
b2.createRopeJointDef creates and returns a rope joint definition table
b2.createWeldJointDef creates and returns a weld joint definition table
b2.createWheelJointDef creates and returns a wheel joint definition table
b2.getScale returns the global pixels to meters scale
b2.setScale sets the global pixels to meters scale

Events

Constants

b2.DISTANCE_JOINT
b2.DYNAMIC_BODY
b2.FRICTION_JOINT
b2.GEAR_JOINT
b2.KINEMATIC_BODY
b2.MOUSE_JOINT
b2.PRISMATIC_JOINT
b2.PULLEY_JOINT
b2.REVOLUTE_JOINT
b2.ROPE_JOINT
b2.STATIC_BODY
b2.WELD_JOINT
b2.WHEEL_JOINT