radsun
18-10-2007 08:27:46
I use Basic Tutorial 1 from ogre wiki and trying to add some pices of code from OgreOde Walking Character but its not working
These is my code:
These is my code:
#include "ExampleApplication.h"
#include "OgreOde_Core.h"
#include "OgreOde_Prefab.h"
#include "OgreOde_Loader.h"
OgreOde::World *_world;
class MarshintoApp : public ExampleApplication
{
protected:
public:
MarshintoApp(){}
~MarshintoApp(){ }
protected:
void createScene(void)
{
Entity* ninja = mSceneMgr->createEntity("ninja","ninja.mesh");
SceneNode* ninjaNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("ninja");
SceneNode* modelNode = ninjaNode->createChildSceneNode("ninja_model");
modelNode->attachObject(ninja);
ninjaNode->setScale(0.25,0.25,0.25);
AxisAlignedBox aab = modelNode->getAttachedObject("ninja")->getBoundingBox();
Ogre::Vector3 min = aab.getMinimum()*ninjaNode->getScale();
Ogre::Vector3 max = aab.getMaximum()*ninjaNode->getScale();
Ogre::Vector3 center = aab.getCenter()*ninjaNode->getScale();
Ogre::Vector3 size(fabs(max.x-min.x),fabs(max.y-min.y),fabs(max.z-min.z));
float radius = (size.x>size.z)?size.z/2.0f:size.x/2.0f;
OgreOde::SimpleSpace* dollSpace = new OgreOde::SimpleSpace(_world,_world->getDefaultSpace());
}
};
#include "windows.h"
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
{
MarshintoApp app;
try
{
app.go();
} catch( Exception& e ) {
MessageBox( NULL, e.getFullDescription().c_str(), "BÅ