This thread is meant to serve as an open discussion on how to best include the engine.
The source code and demos for PAPPE are available here: https://sourceforge.net/projects/pappe/
There is no documentation except for the demo projects, and the 7000-line source file have no comments. Almost like the code for ZGE then
However it looks rather easy to use.
Initialize engine:
Code: Select all
PhysicsInit(Physics);
PhysicsInstance:=@Physics;
PhysicsInstance^.SweepAndPruneWorkMode:=sapwmAXISAUTO;
PhysicsCollideInit(Collide);
Code: Select all
PhysicsObjectInit(Object,BodyBox);
[...various calls to define mesh...]
PhysicsObjectFinish(Object);
PhysicsRigidBodyInit(ObjectRigidBody,@Object,50,0.5,0.8);
Code: Select all
for each object
PhysicsObjectUpdate(Object,TimeStep);
PhysicsUpdate(Physics,TimeStep);
Code: Select all
for each object
PhysicsObjectDone(Object);
PhysicsRigidBodyDone(ObjectRigidBody);
PhysicsCollideDone(Collide);
PhysicsDone(Physics);
An example how zge would be used with an unmodified version of pappe:
Code: Select all
init zge-model
somehow copy all meshes and transforms from OnRender to poppe-physicsobject mesh
for each time step
for each zge-Model that have UsePhysics=True
copy model state to pappe-physicsobject
call poppe PhysicsObjectUpdate
move model state back from pappe-physicsobject to zge-model
So these are just my initial thoughts on this, please feel free to offer ideas and suggestions.