- - included w0rm's MeshSplitter Tool (with his permission )
- added experimental destruction support (see this thread)
- added destruction demo
- fixed project file settings, see README
I also added a binary Destruction Demo (Windows).
Download source archieve, including w0rms Mesh Splitter Tool.
Download binary destruction demo (Windows) and binary MeshSplitter Tool.
===============================================================================
I wrote a small PhysX wrapper and decided to share it, maybe somebody will find it useful.
Features:
- PhysX initialisation
- bind scene nodes or other "PointRenderable" implementations to actors
- mesh cooking
- raycasting
- destructible objects
I will probably implement more features in the future, but the main idea is to keep the wrapper small and simple.
The attached zip file contains the library and a small demo. You need PhysX 3.1 to use OgrePhysX.
Some example code:
Initialisation
Code: Select all
#include "OgrePhysX.h"
class MyGame
{
...
Ogre::SceneManager *mOgreSceneMgr;
OgrePhysX::Scene *mPhysXScene;
}
//...
OgrePhysX::World::getSingleton().init();
OgrePhysX::World::getSingleton().setupOgreFramelistener();
mPhysXScene = OgrePhysX::World::getSingleton().addScene("Main", mOgreSceneMgr);
//...
Binding a node to an actor
Code: Select all
Ogre::SceneNode *node = mSceneMgr->getRootSceneNode()->createChildSceneNode();
Ogre::Entity *ent = mSceneMgr->createEntity("Cube", "cube.mesh");
node->attachObject(ent);
//create physical actor
OgrePhysX::Actor<PxRigidDynamic> actor = mPhysXScene->createRigidDynamic(ent, 50);
//setup binding
mPhysXScene->createRenderedActorBinding(actor, new OgrePhysX::NodeRenderable(node));
actor.setGlobalPosition(Ogre::Vector3(0, 20, 10));
Static actors / cooking PhysX meshes
Code: Select all
Ogre::Entity *ent = mSceneMgr->createEntity("Cube", "cube.mesh");
Actor<PxRigidStatic> actor = mPhysXScene->createRigidStatic(ent);
And finally, a screenshot: