betajaen
14-05-2007 10:36:39
Hi Sports Fans!
These tips and code snippets are to help you get your current 0.4RC3/0.6 code over to massive changes in NxOgre 0.9. Please join in with your own things if you like, but any questions would you take to a seperate thread. I like things clean.
So here we go:
The Basics
- Classes names use CamelCase; World, Scene, SceneParams, CharacterMovementVectorController
- Everything is in SI units; metres, kilograms and newtons.
Actors
- Actor is equivalent to NxActor.
- Bodies are Actors with a scene node.
- Actors don't have scene nodes.
- Most parts of NxOgre deal with Actors, so you need to quickly swap between them:- Actor* a = static_cast<Actor*>(myBody), Actor* myBody = mScene->createBody(..);
- Static bodies are created using params;
- Bodies use the mesh name as the name (and make one up if it's already taken), Actors use the name given. This feature will be extended in the future to allow custom names to bodies, without breaking the interface.
Debugging and the Error System
- There is no DebugOverlay and DebugNode, it's been taken out, gone, exploded, finished, buried and composted. Use the PhysX Remote Debugger instead!
- Run the PhysX Remote Debugger on your computer or another on a home or business network, you connect to it via the IP address:
This feature will be more streamlined in the future, and will support custom data such as node or state information.
- There is an Error System, which you can plug into with your own Error Reporter class, or you can make due with the logging system.
- The text log system uses three formats; text, html and phpbb formatted. Configured via the World:-
- If you use your own error system, and want NxOgre to work with it, then it can:
These tips and code snippets are to help you get your current 0.4RC3/0.6 code over to massive changes in NxOgre 0.9. Please join in with your own things if you like, but any questions would you take to a seperate thread. I like things clean.
So here we go:
The Basics
- Classes names use CamelCase; World, Scene, SceneParams, CharacterMovementVectorController
- Everything is in SI units; metres, kilograms and newtons.
Actors
- Actor is equivalent to NxActor.
mBody->createActor("myActorName"new SphereShape(0.5f), Vector3(5,10,5), "mass: 10");
- Bodies are Actors with a scene node.
mBody->createBody("myActorName;meshName.mesh"new SphereShape(0.5f), Vector3(5,10,5), "mass: 10");
- Actors don't have scene nodes.
- Most parts of NxOgre deal with Actors, so you need to quickly swap between them:- Actor* a = static_cast<Actor*>(myBody), Actor* myBody = mScene->createBody(..);
- Static bodies are created using params;
mBody->createBody("nx.sphere.50cm.mesh", new SphereShape(0.5f), Vector3(5,10,5), "Static: Yes");
- Bodies use the mesh name as the name (and make one up if it's already taken), Actors use the name given. This feature will be extended in the future to allow custom names to bodies, without breaking the interface.
Debugging and the Error System
- There is no DebugOverlay and DebugNode, it's been taken out, gone, exploded, finished, buried and composted. Use the PhysX Remote Debugger instead!
- Run the PhysX Remote Debugger on your computer or another on a home or business network, you connect to it via the IP address:
mWorld->getPhysXDriver()->getSDK()->getFoundationSDK().getRemoteDebugger()->connect("127.0.0.1");
This feature will be more streamlined in the future, and will support custom data such as node or state information.
- There is an Error System, which you can plug into with your own Error Reporter class, or you can make due with the logging system.
- The text log system uses three formats; text, html and phpbb formatted. Configured via the World:-
mWorld = new World("FrameListener: Yes, log: none");
mWorld = new World("FrameListener: Yes, log: text");
mWorld = new World("FrameListener: Yes, log: html");
mWorld = new World("FrameListener: Yes, log: phpbb");
- If you use your own error system, and want NxOgre to work with it, then it can:
class myNxOgreErrorSystem : public ErrorReporter {
public:
myNxOgreErrorSystem() {
MyErrorSystem::getSingleton()->createErrorSubSection("Physics");
}
~myNxOgreErrorSystem () {
MyErrorSystem::getSingleton()->destroyErrorSubSection("Physics");
}
void report(const ErrorReport& r) {
MyErrorSystem::getSingleton()->reportError("Physics", r.Caller, r.Message, r.Frame);
}
};
...
mWorld = new World("FrameListener: Yes, log: none");
myNxOgreErrorSystem* physxerrorsys = new myNxOgreErrorSystem();
NxOgre::Error::getInstance()->addReporter(physxerrorsys, false);
...
delete mWorld;
delete physxerrorsys;