Skip to content

This extension provides a reader to the AndEngine Exporter format of the PhysicsEditor (http://www.physicseditor.de/). This gives you the power to draw your physical shapes and integrate them with just one line of code.

Notifications You must be signed in to change notification settings

ANDLABS-Git/AndEngine-PhysicsEditor-Extension

Repository files navigation

AndEngine-PhysicsEditor-Extension

This extension provides a reader to the AndEngine Exporter format of the PhysicsEditor (http://www.physicseditor.de/). This gives you the power to draw your physical shapes and integrate them with just one line of code.

Use it like this:

  1. Provide the AndEngine and AndEnginePhysicsBox2DExtension
  2. Put your XML output somewhere in your assets, for example in a folder called 'xml'.
  3. Use the PhysicsEditorLoader like so:
final PhysicsEditorLoader loader = new PhysicsEditorLoader();
try {
    loader.load(this, // the context
        mPhysicsWorld, // an already initialized physical world
        "xml/", // the base path to your xml files
        "your_def.xml", // the AndEngine exporter XML of your body or bodies
        yourShape, // the IAreaShape the physics definition will be attached to
        true, // whether the physics definition's position should be updated or not
        true // whether the physics definition's rotation should be updated or not
        );
} catch (IOException e) {
    e.printStackTrace();
}

When loading multiple definitions, call

loader.reset();

in between. For debugging, you can also call

loader.loadDebug(pContext, pPhysicsWorld, pScene, pAssetBasePath, pAssetPath, 
     pShape, pUpdatePosition, pUpdateRotation, pVertexBufferObjectManager)

to see into which triangles your definition is separated. Please note that this feature is beta.

You also might want to take a look at the examples: https://github.com/ANDLABS-Git/AndEngine-PhysicsEditor-Extension-Examples

About

This extension provides a reader to the AndEngine Exporter format of the PhysicsEditor (http://www.physicseditor.de/). This gives you the power to draw your physical shapes and integrate them with just one line of code.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages