ncomputerm4
17-06-2007 20:39:45
Ok, I've read about the changes in how to make objects in .9 but I haven’t found a list of the needed includes. I've added more includes than the tutorial had in it (trying 101)
heres my code:
The first part does not work at all, but when I take it out I get
"Error 1 error C2065: 'mWorld' : undeclared identifier h:\game files\nxogre\compiler\main.cpp 27 "
I know this is a very newbie question, but I can't find any working examples on the form.
heres my code:
#include "NxOgre.h"
#include "NxogreStable.h"
#include "NxOgreWorld.h"
#include "NxOgreScene.h" // For: Scene operations
#include "NxOgreHelpers.h" // For: Incase of Scene duplicate names.
#include "NxOgreCharacterController.h" // For: Setting up character controller
#include "time.h"
#include "Ogre.h"
//using namespace nxOgre;
using namespace Ogre;
using namespace std;
class NxTutorial : public SimpleTutorial {
public:
world *mWorld;
scene *mScene;
//////////////////////////////////////////////////////////////////////////////////////////////////
void start() {
mWorld = new World();
mScene = mWorld->createScene("Main", mSceneMgr, "gravity: yes, floor: yes");
mScene->createActor("FakeFloor", new CubeShape(100,2.1f,100), Vector3(0,-0.05f,0), "static: yes");
mScene->createBody("cube.1m.mesh", new CubeShape(1,1,1), Vector3(0,3,0), "Mass: 100");
mScene->createBody("sphere.50cm.mesh", new SphereShape(0.5), Vector3(0,6,0), "Mass: 20");
mScene->createBody("capsule.50cmx1m.mesh", new CapsuleShape(0.5,1), Vector3(0,8,0), "Mass: 15");
mScene->createBody("convex1.mesh", new ConvexShape("convex1.mesh"), Vector3(0,10,0), "Mass: 7.5");
mScene->createBody("prism.8x50cmx2m.mesh", new PrismShape(0.5,2,8), Vector3(0,12,0), "Mass: 5");
mScene->createBody("cube.1m.mesh", new CubeShape(1,1,1), Vector3(0,3,5), "static: yes");
mScene->createBody("nx.convex.mesh", new ConvexShape("nx.convex.mesh"), NxOgre::Pose(Vector3(5,5,5),Quaternion(sqrt(0.5),-sqrt(0.5),0,0)), "Mass: 1000");
for (int i=0;i < 32;i++) {
NxReal h = NxMath::rand(1,4);
mScene->createBody("cube.1m.mesh", new CubeShape(1.0f,h,1.0f), Vector3(0,10.25f + h,i), "Mass: 100, node-scale: 1 " + Ogre::StringConverter::toString(h) + " 1");
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////
void stop() {
// Time to go, better tell NxOgre we are leaving.
delete mWorld;
}
//////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////
void getTutorialSettings() {
mTutorialName = "101";
mTutorialDescription = "Cube on a plane";
}
//////////////////////////////////////////////////////////////////////////////////////////////////
void prestart() {}
void prestop() {}
// void GUIbuttonPressed(BetaGUI::Button *ref) {}
//////////////////////////////////////////////////////////////////////////////////////////////////
};
TUTORIAL_VOIDMAIN
The first part does not work at all, but when I take it out I get
"Error 1 error C2065: 'mWorld' : undeclared identifier h:\game files\nxogre\compiler\main.cpp 27 "
I know this is a very newbie question, but I can't find any working examples on the form.