Base Application

moore

18-03-2011 16:19:05

Hi, i finally build nxogre tutorials, but now i want to do separate application(without running samplebrowser). I use code from this page and changed tutorialapplication.cpp:

void TutorialApplication::createScene(void)
{
// Create the world.
mWorld = NxOgre::World::createWorld();

mWorld->getRemoteDebugger()->connect();

// Create the scene
NxOgre::SceneDescription scene_description;
scene_description.mGravity = NxOgre::Constants::MEAN_EARTH_GRAVITY;
scene_description.mUseHardware = false;

mScene = mWorld->createScene(scene_description);

// Set default material properties
mDefaultMaterial = mScene->getMaterial(0);
mDefaultMaterial->setRestitution(0.1f);
mDefaultMaterial->setDynamicFriction(0.9);
mDefaultMaterial->setStaticFriction(0.5);

// Plane creation
mScene->createSceneGeometry(NxOgre::PlaneGeometryDescription());

// Create the rendersystem.
mRenderSystem = new Critter::RenderSystem(mScene, mSceneMgr);
mRenderSystem->createVisualDebugger();

// Setup a BodyDescription.
Critter::BodyDescription bodyDescription;
bodyDescription.mMass = 40.0f; // Set the mass to 40kg.

// Finally create the body.
mBody = mRenderSystem->createBody(NxOgre::BoxDescription(1,1,1), NxOgre::Vec3(0,5,0), "cube.1m.mesh", bodyDescription);

// create a floor mesh resource
Ogre::MeshManager::getSingleton().createPlane("floor", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
Plane(Vector3::UNIT_Y, 0), 1000, 1000, 1,1 , true, 1, 1, 1, Vector3::UNIT_Z);

// create a floor entity, give it a material, and place it at the origin
Entity* floor = mSceneMgr->createEntity("Floor", "floor");
floor->setMaterialName("ground-from-nxogre.org");
floor->setCastShadows(false);
mSceneMgr->getRootSceneNode()->attachObject(floor);

}

But i get error:
e:\ogre\ogresdk_vc10\add-ons\nxogre\critter\sdk\CritterStable.h(45): fatal error C1083: Cannot open include file: 'OGRE/Ogre.h': No such file or directory
My second question is whether it is better to build applications with the dll or same exe?

betajaen

18-03-2011 17:52:24

You didn't include the Ogre folder in the header settings;

http://www.ogre3d.org/tikiwiki/Setting+ ... irectories

moore

18-03-2011 21:00:48

Yea i forgot about $(OGRE_HOME)\include\OGRE. But now i get errors:
..\TutorialApplication.cpp(33): error C2065: 'mWorld' : undeclared identifier
..\TutorialApplication.cpp(35): error C2065: 'mWorld' : undeclared identifier
..\TutorialApplication.cpp(35): error C2227: left of '->getRemoteDebugger' must point to class/struct/union/generic type
type is ''unknown-type''
..\TutorialApplication.cpp(35): error C2227: left of '->connect' must point to class/struct/union/generic type
..\TutorialApplication.cpp(42): error C2065: 'mScene' : undeclared identifier
..\TutorialApplication.cpp(42): error C2065: 'mWorld' : undeclared identifier
..\TutorialApplication.cpp(42): error C2227: left of '->createScene' must point to class/struct/union/generic type
type is ''unknown-type''
..\TutorialApplication.cpp(45): error C2065: 'mDefaultMaterial' : undeclared identifier
..\TutorialApplication.cpp(45): error C2065: 'mScene' : undeclared identifier
..\TutorialApplication.cpp(45): error C2227: left of '->getMaterial' must point to class/struct/union/generic type
type is ''unknown-type''
..\TutorialApplication.cpp(46): error C2065: 'mDefaultMaterial' : undeclared identifier
..\TutorialApplication.cpp(46): error C2227: left of '->setRestitution' must point to class/struct/union/generic type
type is ''unknown-type''
..\TutorialApplication.cpp(47): error C2065: 'mDefaultMaterial' : undeclared identifier
..\TutorialApplication.cpp(47): error C2227: left of '->setDynamicFriction' must point to class/struct/union/generic type
type is ''unknown-type''
..\TutorialApplication.cpp(48): error C2065: 'mDefaultMaterial' : undeclared identifier
..\TutorialApplication.cpp(48): error C2227: left of '->setStaticFriction' must point to class/struct/union/generic type
type is ''unknown-type''
..\TutorialApplication.cpp(51): error C2065: 'mScene' : undeclared identifier
..\TutorialApplication.cpp(51): error C2227: left of '->createSceneGeometry' must point to class/struct/union/generic type
type is ''unknown-type''
..\TutorialApplication.cpp(54): error C2065: 'mRenderSystem' : undeclared identifier
..\TutorialApplication.cpp(54): error C2065: 'mScene' : undeclared identifier
..\TutorialApplication.cpp(55): error C2065: 'mRenderSystem' : undeclared identifier
..\TutorialApplication.cpp(55): error C2227: left of '->createVisualDebugger' must point to class/struct/union/generic type
type is ''unknown-type''
..\TutorialApplication.cpp(62): error C2065: 'mBody' : undeclared identifier
..\TutorialApplication.cpp(62): error C2065: 'mRenderSystem' : undeclared identifier
..\TutorialApplication.cpp(62): error C2227: left of '->createBody' must point to class/struct/union/generic type
type is ''unknown-type''
..\TutorialApplication.cpp(65): error C2653: 'ResourceGroupManager' : is not a class or namespace name
..\TutorialApplication.cpp(65): error C2065: 'DEFAULT_RESOURCE_GROUP_NAME' : undeclared identifier
..\TutorialApplication.cpp(66): error C2653: 'Vector3' : is not a class or namespace name
..\TutorialApplication.cpp(66): error C2065: 'UNIT_Y' : undeclared identifier
..\TutorialApplication.cpp(66): error C2653: 'Vector3' : is not a class or namespace name
..\TutorialApplication.cpp(66): error C2065: 'UNIT_Z' : undeclared identifier
..\TutorialApplication.cpp(66): error C3861: 'Plane': identifier not found
..\TutorialApplication.cpp(69): error C2065: 'Entity' : undeclared identifier
..\TutorialApplication.cpp(69): error C2563: mismatch in formal parameter list
..\TutorialApplication.cpp(69): error C2568: '*' : unable to resolve function overload
E:\Visual C++ 2010 Express Edition\VC\include\math.h(567): could be 'long double floor(long double)'
E:\Visual C++ 2010 Express Edition\VC\include\math.h(519): or 'float floor(float)'
E:\Visual C++ 2010 Express Edition\VC\include\math.h(136): or 'double floor(double)'
..\TutorialApplication.cpp(70): error C2227: left of '->setMaterialName' must point to class/struct/union/generic type
..\TutorialApplication.cpp(71): error C2227: left of '->setCastShadows' must point to class/struct/union/generic type
..\TutorialApplication.cpp(72): error C2664: 'Ogre::SceneNode::attachObject' : cannot convert parameter 1 from 'overloaded-function' to 'Ogre::MovableObject *'
Context does not allow for disambiguation of overloaded function

I completely have no idea how to build ogre and nxogre without using samplebrowser.

Nixit28

28-04-2011 12:35:01

I completely have no idea how to build ogre and nxogre without using samplebrowser.


hey do you found the solution...???? :?:

moore

30-04-2011 22:27:26

No. I tried with newton, but i also get errors and now i'm thinking about ODE, but ifsomeone finally solve this problem i would back to nxogre.

moore

02-05-2011 18:01:56

So, will anyone help?

betajaen

02-05-2011 18:08:03

Looks like you didn't define the World, Scene, pointers and/or include the NxOgre and/or Ogre headers.