pal - Physics Abstraction Layer

Your best "pal" when push comes to shove....

Introduction

PAL is a C++ physics abstraction system. This allows you to rapidly develop applications that support various physics engines.

Goal:

Provide a single, flexible API to access a variety of physics engines.

Available Implementations:

PAL is available for: (alphabetical listing)

Installation

If you wish to use all of PAL's extended functionality:

Requirements

The following compilers are currently supported:

Microsoft:

GNU

PAL Information

Example

Just starting?

Try the simple examples. Then take a look at palFactory and follow the documentation links!

Tiny example of using PAL directly

        PF->SelectEngine(szEngine); //szEngine is the name of the engine you wish to use. eg:"ODE"
        palPhysics *pp = PF->CreatePhysics(); //create the main physics class
        pp->Init(0,-9.8f,0); //initialize it, set the main gravity vector
        palTerrainPlane *pt= PF->CreateTerrainPlane(); //create the ground
        pt->Init(0,0,0,50.0f); //initialize it, set its location to 0,0,0 and minimum size to 50
        palBox *pb = PF->CreateBox(); //create a box
        pb->Init(0,5,0, 1,1,1, 1); //initialize it, set its location to 0,5,0 (five units up in the air), set dimensions to 1x1x1 and its mass to 1
        while (!quit) { //loop until done
                pp->Update(0.02f); //update the physics engine. advance the simulation time by 0.02

                palMatrix4x4 m;
                m=pb->GetLocationMatrix(); //get the location of the box (transformation matrix)
                //display the box
        }

        PF->Cleanup(); //we are done with the physics. clean up.

Example of using PAL via XML

NOTE: PAL XML is now unsupported, try PAL COLLADA and PAL Scythe instead **

        palXMLFactory px;
        px.LoadXML(szFilename); //eg:"physics.xml"
        palPhysics *pp = palGetObject<palPhysics>("Physics"); //get the physics engine described in the XML file
        palBox *pb = palGetObject<palBox>("box0"); //get the box described in the XML file - all objects can also be accessed via a public vector array in the XML factory
        while (!quit) { //loop until done
                pp->Update(0.02f); //update the physics engine. advance the simulation time by 0.02

                palMatrix4x4 m;
                m=pb->GetLocationMatrix(); //get the location of the box (transformation matrix)
                //display the box
        }

         PF->Cleanup(); //we are done with the physics. clean up.

Credits

PAL created by Adrian Boeing.

Diagrams created by Martin Sawtell.

Some code based from ODE and MESA libraries.


Generated on Mon Aug 31 13:58:02 2009 for pal by  doxygen 1.5.7.1