Package net.dermetfan.gdx.physics.box2d
package net.dermetfan.gdx.physics.box2d
-
ClassDescriptionParses
MapObjectsfrom aMapand generates Box2DBodies,FixturesandJointsfrom them.
Just create a newBox2DMapObjectParserand callBox2DMapObjectParser.load(World, MapLayer)to load all compatible objects (defined by the theBox2DMapObjectParser.aliases) into yourWorld.
If you only want specific Fixtures or Bodies, you can use theBox2DMapObjectParser.createBody(World, MapObject)andBox2DMapObjectParser.createFixture(MapObject)methods.
How you define compatible objects in the TiledMap editor:
In your object layer, right-click an object and set its properties to those of the Body/Fixture/both (in case you're creating anobject) you'd like, as defined in the usedBox2DMapObjectParser.Aliasesobject.
For type, you have to chooseBox2DMapObjectParser.Aliases.body,Box2DMapObjectParser.Aliases.fixtureorBox2DMapObjectParser.Aliases.object.
To add Fixtures to a Body, add aBox2DMapObjectParser.Aliases.bodyproperty with the same value to each Fixture of a Body.
To createJoints, add any object to the layer and just put everything needed in its properties.defines theBox2DMapObjectParser.aliasesto use when parsingAllows modification ofMapObjectsbefore they are used to create Box2D objects.
Note that the map object given to you is the one directly from the map, so if you modify it, you modify theMapinstance! If you want to avoid that, make a copy.
Also listens to Box2D objects that have been created.Does nothing.provides methods for operations with Box2DBodies,FixturesandShapeschecks if Box2D's preconditions are met to avoid native crashesindicates that a ChainShape cannot be created from this polylinethe reason why this ChainShape cannot be createdindicates that a PolygonShape cannot be created from this polygonthe reason this shape is invalidindicates that a poly shape cannot be created from these verticesb2Settings.hcached method resultsBreaks bodies or fixtures if they get hit too hard.a callback for aBreakableif its container (body or fixture) was destroyed (for example to play a sound)Returns false in all methods implemented fromBreakable.Callback.Manages theBreakablesof the Contacts it receives.HoldsChain.segmentsandChain.connectionsto simulate a chain.used by aChainto modify itholds one or morejointsaChain.CopyBuilderthat uses aJointDefinChain.JointDefCopyBuilder.createConnection(Body, int, Body, int)Override this if you only want to use a subset of methods of theContactListener.aContactListenerthat sendsContactsto anArrayof ContactListenersanInputAdaptermanaging aMouseJointDoes nothing and returns false.moves a body to a position using forcesthe derivative control loop componentthe proportional control loop componenta proportional-derivative controllerrotates a body to an angle using torquethe derivative control loop componentthe proportional control loop componenta proportional-derivative controllerNotifies aWorldObserver.Listenerof changes in the world.the changes of aBodythe changes of an object in a world since the last timeWorldObserver.Change.update(Object)was calledthe changes of aDistanceJointthe changes of aFixturethe changes of aFrictionJointthe changes of aGearJointWorldObserver.JointChange<T extends com.badlogic.gdx.physics.box2d.Joint>the changes of aJointthe listener notified by aWorldObserverA class that implements Listener.the changes of aMotorJointthe changes of aMouseJointthe changes of aPrismaticJointthe changes of aRevoluteJointthe changes of aRopeJointA Listener that calls another Listener on unpredictable/unexpected events.the changes of aWeldJointthe changes of aWheelJointthe changes of aWorld