Code Monkey home page Code Monkey logo

andengine-physicseditor-extension's Introduction

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

andengine-physicseditor-extension's People

Watchers

bruce avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.