To get a quick idea what this is all about, view my Youtube demonstration video here -> https://youtu.be/zdUW69nzy8w
In case you don't know, LiquidFun (see http://google.github.io/liquidfun) and Box2D (see https://github.com/erincatto/Box2D) are both physics engines. Together they simulate physical systems using particle systems, rigid bodies, joints and collision detection. Box2D is arguably the most prevalent physics engine in existence right now. It's the engine behind many popular physics-based games like Angry Birds, and is also at the core of other advanced physics engines such as Unity. LiquidFun is a particle physics extension to Box2D, created by Google.
This library incorporates many of the functions of LiquidFun and Box2D into PureBasic and utilises PureBasic's great OpenGL features to render the output to the screen. The result is a visual library for 2D physics in PureBasic.
REQUIREMENTS
- PureBasic version 5.60 (other versions may work but untested)
- OpenGL versions 1.2 and higher (other versions may work but untested)
- Windows 7 OS and higher (other versions may work but untested)
This library is split into two halves. LiquidFun-C.pbi includes the functions of the LiquidFun (and Box2D) core. The output of this library is purely mathematical. LiquidFun-C-Ex.pbi is the library I've developed that extends LiquidFun-C.pbi to include additional graphics (OpenGL) and gaming / convenience functions for LiquidFun in PureBasic.
Within the LiquidFun-C.pbi library:
- b2World_Create
- b2World_Step
- b2World_DestroyJoint
- b2World_CreateBody
- b2World_DestroyBody
- b2Body_GetAngularVelocity
- b2Body_SetAngularVelocity
- b2Body_GetPosition
- b2Body_GetAngle
- b2Body_IsActive
- b2Body_SetTransform
- b2Body_ApplyForce
- b2Body_ApplyTorque
- b2Body_GetMass
- b2Body_SetMassData
- b2Body_GetInertia
- b2Body_GetLinearVelocity
- b2Body_SetLinearVelocity
- b2CircleShape_CreateFixture
- b2PolygonShape_CreateFixture_3
- b2PolygonShape_CreateFixture_4
- b2PolygonShape_CreateFixture_5
- b2PolygonShape_CreateFixture_6
- b2PolygonShape_CreateFixture_7
- b2PolygonShape_CreateFixture_8
- b2ChainShape_CreateFixture
- b2Body_DestroyFixture
- b2World_CreateParticleSystem
- b2World_DestroyParticleSystem
- b2ParticleSystem_GetParticleCount
- b2ParticleSystem_GetPositionBuffer
- b2ParticleSystem_SetDensity
- b2ParticleSystem_SetDamping
- b2ParticleSystem_CreateParticle
- b2CircleShape_CreateParticleGroup
- b2ParticleGroup_GetParticleCount
- b2ParticleGroup_DestroyParticles
- b2WeldJointDef_Create
- b2WeldJointDef_InitializeAndCreate
- b2RevoluteJointDef_Create
- b2RevoluteJointDef_InitializeAndCreate
- b2RevoluteJoint_EnableLimit
- b2RevoluteJoint_EnableMotor
- b2RevoluteJoint_GetJointAngle
- b2RevoluteJoint_IsLimitEnabled
- b2RevoluteJoint_IsMotorEnabled
- b2RevoluteJoint_SetMotorSpeed
- b2PrismaticJointDef_Create
- b2PrismaticJointDef_InitializeAndCreate
- b2PrismaticJoint_EnableLimit
- b2PrismaticJoint_EnableMotor
- b2PrismaticJoint_GetJointTranslation
- b2PrismaticJoint_GetMotorSpeed
- b2PrismaticJoint_GetMotorForce
- b2PrismaticJoint_IsLimitEnabled
- b2PrismaticJoint_IsMotorEnabled
- b2PrismaticJoint_SetMotorSpeed
- b2WheelJointDef_Create
- b2WheelJointDef_InitializeAndCreate
- b2WheelJoint_SetMotorSpeed
- b2WheelJoint_SetSpringFrequencyHz
- glTexture_Create
- glTexture_LoadAll
- glDraw_Fixture
- glDraw_Fixtures
- glDraw_ParticleSystem
- glDraw_Particles
- glInfo_Get
- glWindow_Setup
- glWorld_Setup
- glWorld_CreateTextures
- b2Vec2_LinearVelocity
- b2Vec2_Distance
- b2Vec2_Vector_at_Angle_Distance
- b2Vec2_GetAngleBetweenThreePoints
- b2Vec2Array_IsConvexAndClockwise
- b2PolygonShape_CreateFixture
- b2PolygonShape_CrossProductVectorVector
- b2PolygonShape_ComputeCentroid
- b2PolygonShape_MoveToZeroCentroid
- b2Fixture_LoadAll
- b2Body_LoadAll
- b2Body_GetLinearVelocityEx
- b2Body_GetAngularVelocityEx
- b2Body_GetPositionEx
- b2Body_SetPosition
- b2Body_GetAngleEx
- b2Body_SetAngle
- b2Body_AddAngle
- b2Body_AddAngularVelocity
- b2Body_SetAngularVelocityPercent
- b2Joint_LoadAll
- b2ParticleSystem_LoadAll
- b2ParticleGroup_LoadAll
- b2World_CreateJointEx
- b2World_CreateJoints
- b2World_CreateFixtureEx
- b2World_CreateFixtures
- b2World_CreateEx
- b2World_CreateBodyEx
- b2World_CreateBodies
- b2World_CreateBodyAndFixtures
- b2World_CreateBodyAndFixturesAndJoints
- b2World_DestroyBodyEx
- b2World_DestroyBodies
- b2World_FollowBody
- b2World_SetFixturesDrawType
- b2World_DestroyJointEx
- b2World_DestroyJoints
- b2World_DestroyBodyAndJoints
- b2World_CreateParticleSystemEx
- b2World_CreateParticleSystems
- b2World_DestroyParticleSystems
- b2World_CreateParticleGroupEx
- b2World_CreateParticleGroups
- b2World_DestroyParticleGroups
- b2World_CreateAll
- b2World_DestroyAll
Here is a quick direct link to the demonstration (installer) -> https://github.com/seanhaydongriffin/PB ... _setup.exe
For more details on this demonstration, as well as a simple step-by-step example of the library, see my GitHub page below.
DOWNLOADS:
You can access the library, including demonstration and examples, from the following GitHub page
https://github.com/seanhaydongriffin/PB-LiquidFun-C
Hope you all enjoy!
Cheers,
Sean.