Problems with the walking character tutorial

Bruno

06-11-2011 14:05:26

I've recently been tgrying to set up a character controller using the tutorial here: http://www.ogre3d.org/tikiwiki/OgreOde+Walking+Character, but I've run into some problems. Firstly I couldn't get it to complile, I assume this was due to changes in the OgreOde API since that tutorial was published, but once I got that fixed I encountered another problem which was that as soo as I created it, the player would fall straight through my ground (an ode trimesh). My guess is that I didn't set up the ground properly, or the player node is somehow not properly linked to the same space or world, but I'm not very familiar with ODE so I can't say for sure and so far testing by trial-and-error hasn't turned up anything useful.

Here's the code where I create the ground:
// Spawn testing grounds
Ogre::Entity* testingGrounds = mSceneManager->createEntity("TestingGrounds", "Plane.mesh");

Ogre::SceneNode* testingGroundsN = mSceneManager->getRootSceneNode()->createChildSceneNode();
testingGroundsN->attachObject(testingGrounds);
testingGroundsN->setScale(5000.0f, 5000.0f, 5000.0f);// in future all models should be modeled to a scale of 1 blender unit = 1 meter

OgreOde::EntityInformer ei(testingGrounds,testingGroundsN->_getFullTransform());
terrainTriMeshGeom = ei.createStaticTriangleMesh(mWorld, mSpace);
terrainTriMeshGeom->setRayListener(mTriMeshRayListener);

// Create the player
player = new MainPlayer("Player", mSceneManager, mWorld, mSpace, Ogre::Vector3(0,0,0));


And here's the code where I set up the player:
MainPlayer::MainPlayer(Ogre::String name, Ogre::SceneManager* sceneMgr, OgreOde::World* world, OgreOde::Space* space, Ogre::Vector3 location)
{
mName = name;
mSceneMgr = sceneMgr;

mNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(mName + "_node", location);
mSightNode = mNode->createChildSceneNode(mName + "_sight", Ogre::Vector3(0, 160, 0));
mCameraNode = mSightNode->createChildSceneNode(mName + "_camera", Ogre::Vector3(0, 90, 500));

// Create the player model. Replace with placeholder once mesh is available
mEnt = mSceneMgr->createEntity(mName + "_ent", "ninja.mesh");
mModelNode = mNode->createChildSceneNode(mName + "_model");
mModelNode->attachObject(mEnt);

Ogre::AxisAlignedBox aab = mModelNode->getAttachedObject(mName + "_ent")->getBoundingBox();
Ogre::Vector3 min = aab.getMinimum()*mNode->getScale();
Ogre::Vector3 max = aab.getMaximum()*mNode->getScale();
Ogre::Vector3 center = aab.getCenter()*mNode->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;

// Create a new space
OgreOde::SimpleSpace* dollSpace = new OgreOde::SimpleSpace(world, space);
dollSpace->setInternalCollisions(false);

// Create the sphere (feet)
OgreOde::Body* dollFeetBody = new OgreOde::Body(world, mName + "_feet");
dollFeetBody->setMass(OgreOde::SphereMass(70*2.5,radius));
OgreOde::SphereGeometry* feetGeom = new OgreOde::SphereGeometry(radius, world);
OgreOde::TransformGeometry* feetTrans = new OgreOde::TransformGeometry(world, dollSpace);
mModelNode->translate(Ogre::Vector3(0,-radius/mNode->getScale().y,0));
feetTrans->setBody(dollFeetBody);
feetTrans->setEncapsulatedGeometry(feetGeom);
mNode->attachObject(dollFeetBody);

// Create the capsule (torso)
OgreOde::Body* dollTorsoBody = new OgreOde::Body(world, mName + "_torso");
dollTorsoBody->setMass(OgreOde::CapsuleMass(70*2.5,radius,Ogre::Vector3::UNIT_Y,radius));
dollTorsoBody->setAffectedByGravity(false);
dollTorsoBody->setDamping(0,50000);
OgreOde::TransformGeometry* torsoTrans = new OgreOde::TransformGeometry(world, dollSpace);
OgreOde::CapsuleGeometry* torsoGeom = new OgreOde::CapsuleGeometry(radius, size.y-4*radius, world);
torsoGeom->setPosition(Ogre::Vector3(0,size.y-((size.y-4*radius)/2+2*radius),0)); //can't find a good way to explain this
torsoGeom->setOrientation(Ogre::Quaternion(Ogre::Degree(90), Ogre::Vector3::UNIT_X));
torsoTrans->setBody(dollTorsoBody);
torsoTrans->setEncapsulatedGeometry(torsoGeom);
mNode->attachObject(dollTorsoBody);

// Create a joint to attach the two bodies together
OgreOde::HingeJoint* joint = new OgreOde::HingeJoint(world);
joint->attach(dollTorsoBody,dollFeetBody);
joint->setAxis(Ogre::Vector3::UNIT_X); //set the rotation axis

dermont

07-11-2011 13:48:55

Your code doesn't appear complete, this is from some old code I used for the wiki article. It should still compile. Its been a while since I used OgreOde.

Simple.h

#ifndef _PHYSICSOBJECT_H_
#define _PHYSICSOBJECT_H_

// We'll need the OgreOde definitions
#include "OgreOde_Core.h"
#include "OgreOde_Prefab.h"
#include "OgreOde_Loader.h"
#include "ExampleApplication.h"
#include "ExampleFrameListener.h"

class PhysicsObject
{
public:
PhysicsObject(OgreOde::World* _world,
Ogre::Camera* _camera,
Ogre::SceneManager* _sceneMgr)
:mWorld(_world), mCamera(_camera), mSceneMgr(_sceneMgr)
{
}

virtual ~PhysicsObject()
{
destroyJoints();
destroyBodies();
destroyEntities();
destroyGeoms();
destroySpaces();
destroy();
}

void update ( Ogre::Real deltatime=0.005 )
{
}
virtual void mouseReleaseEvent(OIS::Mouse* mouse)
{
}
virtual void mousePressEvent(OIS::Mouse* mouse)
{
}
virtual void mouseMoveEvent(OIS::Mouse* mouse)
{
}

virtual void keyPressEvent(OIS::Keyboard* input)
{
}
virtual void keyReleaseEvent(OIS::Keyboard* input)
{
}
virtual void destroy()
{
}
bool collision(OgreOde::Contact* contact)
{
// Check for collisions between things that are connected and ignore them
OgreOde::Geometry * const g1 = contact->getFirstGeometry();
OgreOde::Geometry * const g2 = contact->getSecondGeometry();

if (g1 && g2)
{
const OgreOde::Body * const b1 = g1->getBody();
const OgreOde::Body * const b2 = g2->getBody();
if (b1 && b2 && OgreOde::Joint::areConnected(b1, b2))
return false;
}

// Set the friction at the contact
contact->setCoulombFriction(OgreOde::Utility::Infinity);
contact->setBouncyness(0.1);
//contact->setCoulombFriction(5.0);
//contact->setFrictionMode(OgreOde::Contact::Flag_SurfaceIsBouncy);
//contact->setCoulombFriction(OgreOde::Utility::Infinity);
// Yes, this collision is valid
return true;
}
virtual const Ogre::String& getName()
{
}

virtual const Ogre::String& getKeys()
{
}

void destroyJoints()
{
// Delete all the joints
for (std::vector<OgreOde::Joint*>::iterator i = _joints.begin();i != _joints.end();++i)
{
delete (*i);
}
}

void destroyBodies()
{
// Run through the list of bodies we're monitoring
for (std::vector<OgreOde::Body*>::iterator i = _bodies.begin();i != _bodies.end();++i)
{
// Get the node this body controls
Ogre::SceneNode* node = static_cast<Ogre::SceneNode*>((*i)->getParentNode());
if (node)
{
// Get its name and remember all the things attached to it
Ogre::String name = node->getName();
int num = node->numAttachedObjects();
for (int cur = 0;cur < num; cur++)
{
Ogre::MovableObject* obj = node->getAttachedObject(cur);
if (obj->getMovableType() != OgreOde::Body::MovableType)
clearList.push_back(obj);
}

// Destroy the node by name
mSceneMgr->getRootSceneNode()->removeAndDestroyChild(name);
}

// Delete the body
delete (*i);
}
}

void destroyEntities()
{
// Remove all the entities we found attached to scene nodes we're controlling
for (std::vector<Ogre::MovableObject*>::iterator i = clearList.begin();i != clearList.end();++i)
{
if ((*i)->getMovableType() == "Entity")
{
Ogre::MovableObject* m = static_cast<Ogre::MovableObject*>(*i);
//_mgr->destroyMovableObject(m->getName(), m->);
mSceneMgr->destroyMovableObject(m);
}
else if ((*i)->getMovableType() == "ParticleSystem")
{
mSceneMgr->destroyParticleSystem(static_cast<Ogre::ParticleSystem*>(*i));
}
}
}

void destroyGeoms()
{
// Delete all the collision geometries
for (std::vector<OgreOde::Geometry*>::iterator i = _geoms.begin();i != _geoms.end();++i)
{
delete (*i);
}
}

void destroySpaces()
{
// Delete all spaces
for (std::vector<OgreOde::Space*>::iterator i = _spaces.begin();i != _spaces.end();++i)
{
delete (*i);
}
}

protected:
OgreOde::World* mWorld;
Ogre::Camera* mCamera;
Ogre::SceneManager* mSceneMgr;

std::vector<OgreOde::Body*> _bodies;
std::vector<OgreOde::Space*> _spaces;
std::vector<OgreOde::Geometry*> _geoms;
std::vector<OgreOde::Joint*> _joints;
std::vector<Ogre::MovableObject*> clearList;

};

typedef std::vector<PhysicsObject*> PhysicsObjectVector;

//protected:

OgreOde::World *mWorld;
OgreOde::Space *mSpace;
OgreOde::StepHandler *mStepper;

//OgreOde::InfinitePlaneGeometry *mGround;
OgreOde::TriangleMeshGeometry*mGround;

OgreOde::Body *mBody;
OgreOde::Geometry *mGeom;
OgreOde::BoxMass mMass;
Ogre::SceneNode *mNode;
Ogre::Entity *mEntity;

//};
#endif



Simple.cpp

#include "Simple.h"

class Character : PhysicsObject
{
public:
Character(OgreOde::World* _world, Ogre::Camera* _camera, Ogre::SceneManager* _sceneMgr)
: PhysicsObject(_world,_camera,_sceneMgr)
{
Ogre::Entity* hero_ent = _sceneMgr->createEntity("ninja","ninja.mesh");
Ogre::SceneNode* hero_node = _sceneMgr->getRootSceneNode()->createChildSceneNode("ninja");
hero_node->attachObject(hero_ent);
hero_node->scale(0.05,0.05,0.05);

Ogre::AxisAlignedBox aab = hero_node->getAttachedObject("ninja")->getBoundingBox();
Ogre::Vector3 min = aab.getMinimum()*hero_node->getScale();
Ogre::Vector3 max = aab.getMaximum()*hero_node->getScale();
Ogre::Vector3 center = aab.getCenter()*hero_node->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;

_space = new OgreOde::SimpleSpace(_world, mWorld->getDefaultSpace());
_space->setInternalCollisions(false);
_space->setAutoCleanup(false);
_spaces.push_back(_space);

OgreOde::Body* dollFeetBody = new OgreOde::Body(_world,"feet");
dollFeetBody->setMass(OgreOde::SphereMass(70*2.5,radius));
OgreOde::SphereGeometry* feetGeom = new OgreOde::SphereGeometry(radius,_world);
OgreOde::TransformGeometry* feetTrans = new OgreOde::TransformGeometry(_world,_space);

feetTrans->setBody(dollFeetBody);
feetTrans->setEncapsulatedGeometry(feetGeom);
hero_node->attachObject(dollFeetBody);

_feet = dollFeetBody;
_bodies.push_back(_feet);
_geoms.push_back(_feet->getGeometry(0));

OgreOde::Body* dollTorsoBody = new OgreOde::Body(_world,"torso");
dollTorsoBody->setMass(OgreOde::CapsuleMass(70*2.5,radius,Ogre::Vector3::UNIT_Y,radius));
//dollTorsoBody->setAffectedByGravity(false);
OgreOde::TransformGeometry* torsoTrans = new OgreOde::TransformGeometry(_world,_space);
OgreOde::CapsuleGeometry* torsoGeom = new OgreOde::CapsuleGeometry(radius,size.y-4*radius,_world);
torsoGeom->setPosition(Ogre::Vector3(0,size.y-((size.y-4*radius)/2+2*radius),0));
torsoGeom->setOrientation(Ogre::Quaternion(Ogre::Degree(90),Ogre::Vector3::UNIT_X));
torsoTrans->setBody(dollTorsoBody);
torsoTrans->setEncapsulatedGeometry(torsoGeom);
//hero_node->translate(Ogre::Vector3(0,-20,0));

hero_node->attachObject(dollTorsoBody);
_torso = dollTorsoBody;
_bodies.push_back(_torso);
_geoms.push_back(_torso->getGeometry(0));

//feetTrans->setOffsetPosition(Ogre::Vector3(0,1.8,0));
//torsoTrans->setOffsetPosition(Ogre::Vector3(0,1.8,0));

hero_ent->setUserAny(Ogre::Any(torsoTrans));

OgreOde::HingeJoint* joint = new OgreOde::HingeJoint(_world);
joint->attach(dollTorsoBody,dollFeetBody);
joint->setAxis(Ogre::Vector3::UNIT_X);
_joints.push_back(joint);
}

void keyPressEvent2(OIS::Keyboard* Keyboard)
{
OgreOde::Body* dollFeetBody = _feet;
OgreOde::Body* dollTorsoBody = _torso;

if(Keyboard->isKeyDown(OIS::KC_1))
{
Quaternion q = dollTorsoBody->getOrientation();
dollFeetBody->wake();
dollFeetBody->setAngularVelocity(q * Ogre::Vector3(10 * cos(1.0f), 0, 10 * sin(1.0f)));
}
else if(Keyboard->isKeyDown(OIS::KC_2))
{
Quaternion q1 = dollTorsoBody->getOrientation();
Quaternion q2(Degree(-4), Ogre::Vector3::UNIT_Y);
dollTorsoBody->setOrientation(q1 * q2);
}
else
{
dollFeetBody->setAngularVelocity(Ogre::Vector3(0, 0, 0));
dollFeetBody->setLinearVelocity(Vector3(0, dollFeetBody->getLinearVelocity().y, 0));
}

Quaternion q = dollTorsoBody->getOrientation();
Vector3 x = q.xAxis();
Vector3 y = q.yAxis();
Vector3 z = q.zAxis();

dollTorsoBody->wake();
dollTorsoBody->setOrientation(Quaternion(x, Ogre::Vector3::UNIT_Y, z));
}

void keyPressEvent(OIS::Keyboard* input)
{
//std::cout << "GOT HERE " << std::endl;
_ninja_rotate = 0;
_ninja_thrust = 0;
if (input->isKeyDown(OIS::KC_1))
{
_ninja_rotate += -1;
}
if (input->isKeyDown(OIS::KC_2))
{
_ninja_rotate += 1;
}
if (input->isKeyDown(OIS::KC_3))
{
_ninja_thrust += -1;
}
if (input->isKeyDown(OIS::KC_4))
{
_ninja_thrust += 1;
}
if (_ninja_rotate == 0)
{
_feet->wake();
_feet->setAngularVelocity(Ogre::Vector3(_feet->getAngularVelocity().x,0,0));
}
else
{
_feet->wake();
Ogre::Quaternion q1 = _torso->getOrientation();
Ogre::Quaternion q2(Ogre::Degree(-2*_ninja_rotate),Ogre::Vector3::UNIT_Y);
_torso->setOrientation(q1*q2);
}

if (_ninja_thrust == 0)
{
_feet->wake();
_feet->setLinearVelocity(Ogre::Vector3(0,_feet->getLinearVelocity().y,0));
_feet->setAngularVelocity(Ogre::Vector3(0,_feet->getAngularVelocity().y,0));
}
else
{
float speed = 30;
_feet->wake();
Ogre::Quaternion q = _torso->getOrientation();
_feet->setAngularVelocity(q*Ogre::Vector3(speed*_ninja_thrust*cos(1.0),_feet->getAngularVelocity().y,0));
}

Ogre::Quaternion q = _torso->getOrientation();
Ogre::Vector3 x = q.xAxis();
Ogre::Vector3 y = q.yAxis();
Ogre::Vector3 z = q.zAxis();
_torso->wake();
_torso->setOrientation(Ogre::Quaternion(x,Ogre::Vector3::UNIT_Y,z));
_torso->setAngularVelocity(Ogre::Vector3(0,0,0));
}

const Ogre::String& getName()
{
static Ogre::String name = "Ninja Walking Character";
return name;
}

const Ogre::String& getKeys()
{
static Ogre::String keys = "ABCD - move character";
return keys;
}

protected:
OgreOde::Body *_hero;
OgreOde::Body *_feet;
OgreOde::Body *_torso;
int _ninja_rotate,_ninja_thrust;
OgreOde::SimpleSpace* _space;
};

class EventListener : public ExampleFrameListener
{
public:
EventListener(RenderWindow* win, Camera* cam, SceneManager* sm,
PhysicsObjectVector _PhysicsObjectVector)
:ExampleFrameListener(win, cam, false, false),
mPhysicsObjectVector(_PhysicsObjectVector)
{
mSceneMgr=sm;
}

bool frameRenderingQueued(const FrameEvent &evt)
{
bool ret = ExampleFrameListener::frameRenderingQueued(evt);
if (!ret) return false;

if(mKeyboard->isKeyDown(OIS::KC_UP))
{
mBody->addForce(Vector3(0,200,0));
}
if(mKeyboard->isKeyDown(OIS::KC_F1))
{
mBody->setPosition(Vector3(0,200,0));
}

Ogre::Real time = evt.timeSinceLastFrame;

// update physical objects
for (PhysicsObjectVector::iterator i = mPhysicsObjectVector.begin();i != mPhysicsObjectVector.end();++i)
{
(*i)->keyPressEvent(mKeyboard);
(*i)->update(time);
}

// update world
if (mStepper->step(time))
{
mWorld->synchronise();
}

return true;
}

protected:
SceneManager *mSceneMgr; // The current SceneManager
PhysicsObjectVector mPhysicsObjectVector;
};


class CharacterDemo : public ExampleApplication, public OgreOde::CollisionListener
{
protected:
std::vector<PhysicsObject*> mPhysicsObjects;

public:
CharacterDemo()
{

}

~CharacterDemo()
{
// Stop listening for collisions
if (mWorld->getCollisionListener() == this)
mWorld->setCollisionListener(0);

delete mStepper;
delete mGround;

for (std::vector<PhysicsObject*>::iterator i = mPhysicsObjects.begin();i != mPhysicsObjects.end();++i)
{
delete (*i);
}
}

protected:

virtual void createCamera(void)
{
mCamera = mSceneMgr->createCamera("PlayerCam");
// Position and orient the camera

mCamera->setPosition(13,4.5,0);

mCamera->lookAt(0,0.5,0);

mCamera->setNearClipDistance(0.5);

}

virtual void createViewports(void)
{
Viewport* vp = mWindow->addViewport(mCamera);
vp->setBackgroundColour(ColourValue(0,0,0));
mCamera->setAspectRatio(Real(vp->getActualWidth()) / Real(vp->getActualHeight()));
}

void createScene(void)
{
mSceneMgr->setAmbientLight(ColourValue(0.25, 0.25, 0.25));
mSceneMgr->setShadowTechnique(SHADOWTYPE_STENCIL_ADDITIVE);

Light *light = mSceneMgr->createLight("Light1");
light->setType(Light::LT_POINT);
light->setPosition(Vector3(0, 150, 250));
light->setDiffuseColour(0.5, 0.5, 0.5);
light->setSpecularColour(1.0, 1.0, 1.0);

mWorld = new OgreOde::World(mSceneMgr);
mWorld->setGravity(Ogre::Vector3(0,-9.80665,0));
mWorld->setCFM(10e-5);
mWorld->setERP(0.8);
mWorld->setAutoSleep(true);
mWorld->setAutoSleepAverageSamplesCount(10);
mWorld->setContactCorrectionVelocity(1.0);
mSpace = mWorld->getDefaultSpace();
mWorld->setCollisionListener(this);
mWorld->setShowDebugGeometries(true);
//mWorld->setContactSurfaceLayer(1.8);

const Ogre::Real _time_step = 0.5;
const Ogre::Real time_scale = Ogre::Real(1.7);
const Ogre::Real max_frame_time = Ogre::Real(1.0 / 4);
mStepper = new OgreOde::StepHandler(mWorld, OgreOde::StepHandler::QuickStep,_time_step, max_frame_time,time_scale);

SceneNode *track_node = mSceneMgr->getRootSceneNode()->createChildSceneNode("track");

Entity *track_mesh = mSceneMgr->createEntity("track","racingcircuit.mesh");

track_node->attachObject(track_mesh);



OgreOde::EntityInformer ei(track_mesh);

mGround = ei.createStaticTriangleMesh(mWorld, mWorld->getDefaultSpace());

track_mesh->setUserAny(Ogre::Any(mGround));


/*
mGround = new OgreOde::InfinitePlaneGeometry(Plane(Ogre::Vector3(0,1,0),0), mWorld, mWorld->getDefaultSpace());
// Use a load of meshes to represent the floor
int i = 0;
StaticGeometry* s;
s = mSceneMgr->createStaticGeometry("StaticFloor");
s->setRegionDimensions(Ogre::Vector3(160.0, 100.0, 160.0));
// Set the region origin so the center is at 0 world
s->setOrigin(Ogre::Vector3::ZERO);
for (Real z = -80.0;z <= 80.0;z += 20.0)
{
for (Real x = -80.0;x <= 80.0;x += 20.0)
{
String name = String("Ground") + StringConverter::toString(i++);
Entity* entity = mSceneMgr->createEntity(name, "plane.mesh");
entity->setQueryFlags (1<<4);
entity->setUserAny(Ogre::Any(mGround));
entity->setCastShadows(false);
s->addEntity(entity, Ogre::Vector3(x,0,z));
}
}
s->build();
*/

mEntity = mSceneMgr->createEntity("crate","crate.mesh");
mEntity->setQueryFlags (1<<2);
mNode = mSceneMgr->getRootSceneNode()->createChildSceneNode("crate");
mNode->attachObject(mEntity);
mEntity->setCastShadows(true);

mBody = new OgreOde::Body(mWorld);
mNode->attachObject(mBody);

Vector3 size(5.0,5.0,5.0);
OgreOde::BoxMass mMass(0.5,size);
mMass.setDensity(0.04,size);
mGeom = (OgreOde::Geometry*)new OgreOde::BoxGeometry(size/2.0, mWorld, mSpace);
mNode->setScale(size.x * 0.05,size.y * 0.05,size.z * 0.05);
mBody->setMass(mMass);
mGeom->setBody(mBody);
mEntity->setUserAny(Ogre::Any(mGeom));

mBody->setOrientation(Quaternion( Radian(5), Vector3(0,0,0) ));
mBody->setPosition(Vector3(0,220,-20));

Character* mCharacter = new Character(mWorld, mCamera, mSceneMgr);
mPhysicsObjects.push_back((PhysicsObject*)mCharacter);


}

void createFrameListener(void)
{
mFrameListener= new EventListener(mWindow, mCamera, mSceneMgr, mPhysicsObjects);
mFrameListener->showDebugOverlay(true);
mRoot->addFrameListener(mFrameListener);
}

bool collision(OgreOde::Contact* contact)
{
// Check for collisions between things that are connected and ignore them
OgreOde::Geometry * const g1 = contact->getFirstGeometry();
OgreOde::Geometry * const g2 = contact->getSecondGeometry();

if (g1 && g2)
{
const OgreOde::Body * const b1 = g1->getBody();
const OgreOde::Body * const b2 = g2->getBody();
if (b1 && b2 && OgreOde::Joint::areConnected(b1, b2))
return false;
}

// Set the friction at the contact
contact->setCoulombFriction(OgreOde::Utility::Infinity);
//contact->setCoulombFriction(0);

contact->setBouncyness(0.1);
// dWorldSetContactSurfaceLayer(World, 0.001);

return true;
}
};


#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#define WIN32_LEAN_AND_MEAN
#include "windows.h"
#endif

#ifdef __cplusplus
extern "C" {
#endif

#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
#else
int main(int argc, char **argv)
#endif
{
// Create application object
CharacterDemo app;

try {
app.go();
} catch( Exception& e ) {
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
#else
std::cerr << "An exception has occured: " << e.getFullDescription();
#endif
}


return 0;
}

#ifdef __cplusplus
}
#endif

Bruno

28-11-2011 15:42:46

Hi, sorry for my incredibly late reply, I had to take a break from programming for a while because of exams. I tried compiling that code but whenever I try to run it it comes up with an error saying "Could not find material Core/StatsBlockCenter", which doesn't make any sense since I checked and there are no references to any kind of "StatsBlockCenter" in the code.

If it helps, here's the complete log:
01:31:15: Creating resource group General
01:31:15: Creating resource group Internal
01:31:15: Creating resource group Autodetect
01:31:15: SceneManagerFactory for type 'DefaultSceneManager' registered.
01:31:15: Registering ResourceManager for type Material
01:31:15: Registering ResourceManager for type Mesh
01:31:15: Registering ResourceManager for type Skeleton
01:31:15: MovableObjectFactory for type 'ParticleSystem' registered.
01:31:15: OverlayElementFactory for type Panel registered.
01:31:15: OverlayElementFactory for type BorderPanel registered.
01:31:15: OverlayElementFactory for type TextArea registered.
01:31:15: Registering ResourceManager for type Font
01:31:15: ArchiveFactory for archive type FileSystem registered.
01:31:15: ArchiveFactory for archive type Zip registered.
01:31:15: DDS codec registering
01:31:15: FreeImage version: 3.13.1
01:31:15: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
01:31:15: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi,exr,j2k,j2c,jp2,pfm,pct,pict,pic,bay,bmq,cr2,crw,cs1,dc2,dcr,dng,erf,fff,hdr,k25,kdc,mdc,mos,mrw,nef,orf,pef,pxn,raf,raw,rdc,sr2,srf,arw,3fr,cine,ia,kc2,mef,nrw,qtk,rw2,sti,drf,dsc,ptx,cap,iiq,rwz
01:31:15: Registering ResourceManager for type HighLevelGpuProgram
01:31:15: Registering ResourceManager for type Compositor
01:31:15: MovableObjectFactory for type 'Entity' registered.
01:31:15: MovableObjectFactory for type 'Light' registered.
01:31:15: MovableObjectFactory for type 'BillboardSet' registered.
01:31:15: MovableObjectFactory for type 'ManualObject' registered.
01:31:15: MovableObjectFactory for type 'BillboardChain' registered.
01:31:15: MovableObjectFactory for type 'RibbonTrail' registered.
01:31:15: Loading library .\RenderSystem_GL_d
01:31:15: Installing plugin: GL RenderSystem
01:31:15: OpenGL Rendering Subsystem created.
01:31:15: Plugin successfully installed
01:31:15: Loading library .\Plugin_ParticleFX_d
01:31:15: Installing plugin: ParticleFX
01:31:15: Particle Emitter Type 'Point' registered
01:31:15: Particle Emitter Type 'Box' registered
01:31:15: Particle Emitter Type 'Ellipsoid' registered
01:31:15: Particle Emitter Type 'Cylinder' registered
01:31:15: Particle Emitter Type 'Ring' registered
01:31:15: Particle Emitter Type 'HollowEllipsoid' registered
01:31:15: Particle Affector Type 'LinearForce' registered
01:31:15: Particle Affector Type 'ColourFader' registered
01:31:15: Particle Affector Type 'ColourFader2' registered
01:31:15: Particle Affector Type 'ColourImage' registered
01:31:15: Particle Affector Type 'ColourInterpolator' registered
01:31:15: Particle Affector Type 'Scaler' registered
01:31:15: Particle Affector Type 'Rotator' registered
01:31:15: Particle Affector Type 'DirectionRandomiser' registered
01:31:15: Particle Affector Type 'DeflectorPlane' registered
01:31:15: Plugin successfully installed
01:31:15: Loading library .\Plugin_BSPSceneManager_d
01:31:15: Installing plugin: BSP Scene Manager
01:31:15: Plugin successfully installed
01:31:15: Loading library .\Plugin_CgProgramManager_d
01:31:15: Installing plugin: Cg Program Manager
01:31:15: Plugin successfully installed
01:31:15: Loading library .\Plugin_PCZSceneManager_d
01:31:15: Installing plugin: Portal Connected Zone Scene Manager
01:31:15: PCZone Factory Type 'ZoneType_Default' registered
01:31:15: Plugin successfully installed
01:31:15: Loading library .\Plugin_OctreeZone_d
01:31:15: Installing plugin: Octree Zone Factory
01:31:15: Plugin successfully installed
01:31:15: Loading library .\Plugin_OctreeSceneManager_d
01:31:15: Installing plugin: Octree & Terrain Scene Manager
01:31:15: Plugin successfully installed
01:31:15: *-*-* OGRE Initialising
01:31:15: *-*-* Version 1.7.2 (Cthugha)
01:31:15: Creating resource group Essential
01:31:15: Added resource location '../media/thumbnails' of type 'FileSystem' to resource group 'Essential'
01:31:15: Added resource location '../media/packs/SdkTrays.zip' of type 'Zip' to resource group 'Essential'
01:31:15: Added resource location '../media' of type 'FileSystem' to resource group 'General'
01:31:15: Creating resource group Popular
01:31:15: Added resource location '../media/fonts' of type 'FileSystem' to resource group 'Popular'
01:31:15: Added resource location '../media/materials/programs' of type 'FileSystem' to resource group 'Popular'
01:31:15: Added resource location '../media/materials/scripts' of type 'FileSystem' to resource group 'Popular'
01:31:15: Added resource location '../media/materials/textures' of type 'FileSystem' to resource group 'Popular'
01:31:15: Added resource location '../media/materials/textures/nvidia' of type 'FileSystem' to resource group 'Popular'
01:31:15: Added resource location '../media/models' of type 'FileSystem' to resource group 'Popular'
01:31:15: Added resource location '../media/particle' of type 'FileSystem' to resource group 'Popular'
01:31:15: Added resource location '../media/DeferredShadingMedia' of type 'FileSystem' to resource group 'Popular'
01:31:15: Added resource location '../media/PCZAppMedia' of type 'FileSystem' to resource group 'Popular'
01:31:15: Added resource location '../media/RTShaderLib' of type 'FileSystem' to resource group 'Popular'
01:31:15: Added resource location '../media/RTShaderLib/materials' of type 'FileSystem' to resource group 'Popular'
01:31:15: Added resource location '../media/packs/cubemap.zip' of type 'Zip' to resource group 'Popular'
01:31:15: Added resource location '../media/packs/cubemapsJS.zip' of type 'Zip' to resource group 'Popular'
01:31:15: Added resource location '../media/packs/dragon.zip' of type 'Zip' to resource group 'Popular'
01:31:15: Added resource location '../media/packs/fresneldemo.zip' of type 'Zip' to resource group 'Popular'
01:31:15: Added resource location '../media/packs/ogretestmap.zip' of type 'Zip' to resource group 'Popular'
01:31:15: Added resource location '../media/packs/ogredance.zip' of type 'Zip' to resource group 'Popular'
01:31:15: Added resource location '../media/packs/Sinbad.zip' of type 'Zip' to resource group 'Popular'
01:31:15: Added resource location '../media/packs/skybox.zip' of type 'Zip' to resource group 'Popular'
01:31:15: Added resource location '../media/packs/OgreCore.zip' of type 'Zip' to resource group 'Popular'
01:31:17: CPU Identifier & Features
01:31:17: -------------------------
01:31:17: * CPU ID: AuthenticAMD: AMD Athlon(tm) 7750 Dual-Core Processor
01:31:17: * SSE: yes
01:31:17: * SSE2: yes
01:31:17: * SSE3: yes
01:31:17: * MMX: yes
01:31:17: * MMXEXT: yes
01:31:17: * 3DNOW: yes
01:31:17: * 3DNOWEXT: yes
01:31:17: * CMOV: yes
01:31:17: * TSC: yes
01:31:17: * FPU: yes
01:31:17: * PRO: yes
01:31:17: * HT: no
01:31:17: -------------------------
01:31:17: *** Starting Win32GL Subsystem ***
01:31:17: GLRenderSystem::_createRenderWindow "OGRE Render Window", 1024x768 windowed miscParams: FSAA=0 FSAAHint= colourDepth=32 displayFrequency=0 gamma=false vsync=false vsyncInterval=1
01:31:17: Created Win32Window 'OGRE Render Window' : 1040x806, 32bpp
01:31:17: GL_VERSION = 3.3.0
01:31:17: GL_VENDOR = NVIDIA Corporation
01:31:17: GL_RENDERER = GeForce GTS 250/PCI/SSE2
01:31:17: GL_EXTENSIONS = GL_ARB_blend_func_extended GL_ARB_color_buffer_float GL_ARB_compatibility GL_ARB_copy_buffer GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_draw_buffers GL_ARB_draw_elements_base_vertex GL_ARB_draw_instanced GL_ARB_ES2_compatibility GL_ARB_explicit_attrib_location GL_ARB_fragment_coord_conventions GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_geometry_shader4 GL_ARB_get_program_binary GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging GL_ARB_instanced_arrays GL_ARB_map_buffer_range GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_occlusion_query2 GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_provoking_vertex GL_ARB_robustness GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_separate_shader_objects GL_ARB_shader_bit_encoding GL_ARB_shader_objects GL_ARB_shading_language_100 GL_ARB_shading_language_include GL_ARB_shadow GL_ARB_sync GL_ARB_texture_border_clamp GL_ARB_texture_buffer_object GL_ARB_texture_compression GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_float GL_ARB_texture_mirrored_repeat GL_ARB_texture_multisample GL_ARB_texture_non_power_of_two GL_ARB_texture_rectangle GL_ARB_texture_rg GL_ARB_texture_rgb10_a2ui GL_ARB_texture_swizzle GL_ARB_timer_query GL_ARB_transpose_matrix GL_ARB_uniform_buffer_object GL_ARB_vertex_array_bgra GL_ARB_vertex_array_object GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_array GL_ARB_window_pos GL_ATI_draw_buffers GL_ATI_texture_float GL_ATI_texture_mirror_once GL_S3_s3tc GL_EXT_texture_env_add GL_EXT_abgr GL_EXT_bgra GL_EXT_bindable_uniform GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_compiled_vertex_array GL_EXT_Cg_shader GL_EXT_depth_bounds_test GL_EXT_direct_state_access GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXTX_framebuffer_mixed_formats GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_multi_draw_arrays GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_packed_pixels GL_EXT_pixel_buffer_object GL_EXT_point_parameters GL_EXT_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_shader_objects GL_EXT_separate_specular_color GL_EXT_shadow_funcs GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture3D GL_EXT_texture_array GL_EXT_texture_buffer_object GL_EXT_texture_compression_latc GL_EXT_texture_compression_rgtc GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_integer GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object GL_EXT_texture_shared_exponent GL_EXT_texture_sRGB GL_EXT_texture_swizzle GL_EXT_timer_query GL_EXT_vertex_array GL_EXT_vertex_array_bgra GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat GL_KTX_buffer_region GL_NV_blend_square GL_NV_conditional_render GL_NV_copy_depth_to_color GL_NV_copy_image GL_NV_depth_buffer_float GL_NV_depth_clamp GL_NV_explicit_multisample GL_NV_fence GL_NV_float_buffer GL_NV_fog_distance GL_NV_fragment_program GL_NV_fragment_program_option GL_NV_fragment_program2 GL_NV_framebuffer_multisample_coverage GL_NV_geometry_shader4 GL_NV_gpu_program4 GL_NV_half_float GL_NV_light_max_exponent GL_NV_multisample_coverage GL_NV_multisample_filter_hint GL_NV_occlusion_query GL_NV_packed_depth_stencil GL_NV_parameter_buffer_object GL_NV_parameter_buffer_object2 GL_NV_pixel_data_range GL_NV_point_sprite GL_NV_primitive_restart GL_NV_register_combiners GL_NV_register_combiners2 GL_NV_shader_buffer_load GL_NV_texgen_reflection GL_NV_texture_barrier GL_NV_texture_compression_vtc GL_NV_texture_env_combine4 GL_NV_texture_expand_normal GL_NV_texture_multisample GL_NV_texture_rectangle GL_NV_texture_shader GL_NV_texture_shader2 GL_NV_texture_shader3 GL_NV_transform_feedback GL_NV_vertex_array_range GL_NV_vertex_array_range2 GL_NV_vertex_buffer_unified_memory GL_NV_vertex_program GL_NV_vertex_program1_1 GL_NV_vertex_program2 GL_NV_vertex_program2_option GL_NV_vertex_program3 GL_NVX_conditional_render GL_NVX_gpu_memory_info GL_SGIS_generate_mipmap GL_SGIS_texture_lod GL_SGIX_depth_texture GL_SGIX_shadow GL_SUN_slice_accum GL_WIN_swap_hint WGL_EXT_swap_control
01:31:17: Supported WGL extensions: WGL_ARB_buffer_region WGL_ARB_create_context WGL_ARB_create_context_profile WGL_ARB_create_context_robustness WGL_ARB_extensions_string WGL_ARB_make_current_read WGL_ARB_multisample WGL_ARB_pbuffer WGL_ARB_pixel_format WGL_ARB_pixel_format_float WGL_ARB_render_texture WGL_ATI_pixel_format_float WGL_EXT_create_context_es2_profile WGL_EXT_extensions_string WGL_EXT_framebuffer_sRGB WGL_EXT_pixel_format_packed_float WGL_EXT_swap_control WGL_NVX_DX_interop WGL_NV_DX_interop WGL_NV_float_buffer WGL_NV_multisample_coverage WGL_NV_render_depth_texture WGL_NV_render_texture_rectangle
01:31:17: ***************************
01:31:17: *** GL Renderer Started ***
01:31:17: ***************************
01:31:17: Registering ResourceManager for type GpuProgram
01:31:17: GLSL support detected
01:31:17: GL: Using GL_EXT_framebuffer_object for rendering to textures (best)
01:31:17: FBO PF_UNKNOWN depth/stencil support: D16S0 D24S0 D32S0 Packed-D24S8
01:31:17: FBO PF_L8 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8
01:31:17: FBO PF_A8 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8
01:31:17: FBO PF_A4L4 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8
01:31:17: FBO PF_BYTE_LA depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8
01:31:17: FBO PF_R5G6B5 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8
01:31:17: FBO PF_B5G6R5 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8
01:31:17: FBO PF_A1R5G5B5 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8
01:31:17: FBO PF_R8G8B8 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8
01:31:17: FBO PF_B8G8R8 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8
01:31:17: FBO PF_A8R8G8B8 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8
01:31:17: FBO PF_B8G8R8A8 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8
01:31:17: FBO PF_A2R10G10B10 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8
01:31:17: FBO PF_A2B10G10R10 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8
01:31:17: FBO PF_FLOAT16_RGB depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8
01:31:17: FBO PF_FLOAT16_RGBA depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8
01:31:17: FBO PF_FLOAT32_RGB depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8
01:31:17: FBO PF_FLOAT32_RGBA depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8
01:31:17: FBO PF_X8R8G8B8 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8
01:31:17: FBO PF_X8B8G8R8 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8
01:31:17: FBO PF_SHORT_RGBA depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8
01:31:17: FBO PF_R3G3B2 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8
01:31:17: FBO PF_FLOAT16_R depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8
01:31:17: FBO PF_FLOAT32_R depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8
01:31:17: FBO PF_FLOAT16_GR depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8
01:31:17: FBO PF_FLOAT32_GR depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8
01:31:18: FBO PF_SHORT_RGB depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8
01:31:18: [GL] : Valid FBO targets PF_UNKNOWN PF_L8 PF_A8 PF_A4L4 PF_BYTE_LA PF_R5G6B5 PF_B5G6R5 PF_A1R5G5B5 PF_R8G8B8 PF_B8G8R8 PF_A8R8G8B8 PF_B8G8R8A8 PF_A2R10G10B10 PF_A2B10G10R10 PF_FLOAT16_RGB PF_FLOAT16_RGBA PF_FLOAT32_RGB PF_FLOAT32_RGBA PF_X8R8G8B8 PF_X8B8G8R8 PF_SHORT_RGBA PF_R3G3B2 PF_FLOAT16_R PF_FLOAT32_R PF_FLOAT16_GR PF_FLOAT32_GR PF_SHORT_RGB
01:31:18: RenderSystem capabilities
01:31:18: -------------------------
01:31:18: RenderSystem Name: OpenGL Rendering Subsystem
01:31:18: GPU Vendor: nvidia
01:31:18: Device Name: GeForce GTS 250/PCI/SSE2
01:31:18: Driver Version: 3.3.0.0
01:31:18: * Fixed function pipeline: yes
01:31:18: * Hardware generation of mipmaps: yes
01:31:18: * Texture blending: yes
01:31:18: * Anisotropic texture filtering: yes
01:31:18: * Dot product texture operation: yes
01:31:18: * Cube mapping: yes
01:31:18: * Hardware stencil buffer: yes
01:31:18: - Stencil depth: 8
01:31:18: - Two sided stencil support: yes
01:31:18: - Wrap stencil values: yes
01:31:18: * Hardware vertex / index buffers: yes
01:31:18: * Vertex programs: yes
01:31:18: * Number of floating-point constants for vertex programs: 1024
01:31:18: * Number of integer constants for vertex programs: 0
01:31:18: * Number of boolean constants for vertex programs: 0
01:31:18: * Fragment programs: yes
01:31:18: * Number of floating-point constants for fragment programs: 512
01:31:18: * Number of integer constants for fragment programs: 0
01:31:18: * Number of boolean constants for fragment programs: 0
01:31:18: * Geometry programs: yes
01:31:18: * Number of floating-point constants for geometry programs: 512
01:31:18: * Number of integer constants for geometry programs: 0
01:31:18: * Number of boolean constants for geometry programs: 0
01:31:18: * Supported Shader Profiles: arbfp1 arbvp1 fp20 fp30 fp40 glsl gp4gp gpu_gp nvgp4 vp30 vp40
01:31:18: * Texture Compression: yes
01:31:18: - DXT: yes
01:31:18: - VTC: yes
01:31:18: - PVRTC: no
01:31:18: * Scissor Rectangle: yes
01:31:18: * Hardware Occlusion Query: yes
01:31:18: * User clip planes: yes
01:31:18: * VET_UBYTE4 vertex element type: yes
01:31:18: * Infinite far plane projection: yes
01:31:18: * Hardware render-to-texture: yes
01:31:18: * Floating point textures: yes
01:31:18: * Non-power-of-two textures: yes
01:31:18: * Volume textures: yes
01:31:18: * Multiple Render Targets: 8
01:31:18: - With different bit depths: yes
01:31:18: * Point Sprites: yes
01:31:18: * Extended point parameters: yes
01:31:18: * Max Point Size: 63.375
01:31:18: * Vertex texture fetch: yes
01:31:18: * Number of world matrices: 0
01:31:18: * Number of texture units: 32
01:31:18: * Stencil buffer depth: 8
01:31:18: * Number of vertex blend matrices: 0
01:31:18: - Max vertex textures: 32
01:31:18: - Vertex textures shared: yes
01:31:18: * Render to Vertex Buffer : yes
01:31:18: * GL 1.5 without VBO workaround: no
01:31:18: * Frame Buffer objects: yes
01:31:18: * Frame Buffer objects (ARB extension): no
01:31:18: * Frame Buffer objects (ATI extension): no
01:31:18: * PBuffer support: yes
01:31:18: * GL 1.5 without HW-occlusion workaround: no
01:31:18: Registering ResourceManager for type Texture
01:31:18: DefaultWorkQueue('Root') initialising on thread 0x80ec00.
01:31:18: DefaultWorkQueue('Root')::WorkerFunc - thread 0x8d1768 starting.
01:31:18: Particle Renderer Type 'billboard' registered
01:31:18: DefaultWorkQueue('Root')::WorkerFunc - thread 0x8d1798 starting.
01:31:18: SceneManagerFactory for type 'BspSceneManager' registered.
01:31:18: Registering ResourceManager for type BspLevel
01:31:18: SceneManagerFactory for type 'PCZSceneManager' registered.
01:31:18: MovableObjectFactory for type 'PCZLight' registered.
01:31:18: MovableObjectFactory for type 'Portal' registered.
01:31:18: MovableObjectFactory for type 'AntiPortal' registered.
01:31:18: PCZone Factory Type 'ZoneType_Octree' registered
01:31:18: PCZone Factory Type 'ZoneType_Terrain' registered
01:31:18: SceneManagerFactory for type 'OctreeSceneManager' registered.
01:31:18: SceneManagerFactory for type 'TerrainSceneManager' registered.
01:31:18: Parsing scripts for resource group Autodetect
01:31:18: Finished parsing scripts for resource group Autodetect
01:31:18: Parsing scripts for resource group Essential
01:31:18: Parsing script SdkTrays.material
01:31:18: Parsing script SdkTrays.fontdef
01:31:18: Parsing script SdkTrays.overlay
01:31:18: Bad element attribute line: '# you can offset the image to change the cursor "hotspot"' for element SdkTrays/Cursor in overlay
01:31:18: Texture: sdk_cursor.png: Loading 1 faces(PF_A8R8G8B8,32x32x1) with 5 generated mipmaps from Image. Internal format is PF_A8R8G8B8,32x32x1.
01:31:18: Texture: sdk_tray.png: Loading 1 faces(PF_A8R8G8B8,64x64x1) with 5 generated mipmaps from Image. Internal format is PF_A8R8G8B8,64x64x1.
01:31:18: Texture: sdk_button_up.png: Loading 1 faces(PF_A8R8G8B8,128x32x1) with 5 generated mipmaps from Image. Internal format is PF_A8R8G8B8,128x32x1.
01:31:18: Texture: sdk_text_box.png: Loading 1 faces(PF_A8R8G8B8,32x32x1) with 5 generated mipmaps from Image. Internal format is PF_A8R8G8B8,32x32x1.
01:31:18: Texture: sdk_mini_tray.png: Loading 1 faces(PF_A8R8G8B8,32x32x1) with 5 generated mipmaps from Image. Internal format is PF_A8R8G8B8,32x32x1.
01:31:18: Texture: sdk_track.png: Loading 1 faces(PF_A8R8G8B8,16x32x1) with 5 generated mipmaps from Image. Internal format is PF_A8R8G8B8,16x32x1.
01:31:18: Texture: sdk_handle.png: Loading 1 faces(PF_A8R8G8B8,16x16x1) with 4 generated mipmaps from Image. Internal format is PF_A8R8G8B8,16x16x1.
01:31:18: Texture: sdk_mini_text_box.png: Loading 1 faces(PF_A8R8G8B8,32x32x1) with 5 generated mipmaps from Image. Internal format is PF_A8R8G8B8,32x32x1.
01:31:18: Texture: sdk_label.png: Loading 1 faces(PF_A8R8G8B8,32x32x1) with 5 generated mipmaps from Image. Internal format is PF_A8R8G8B8,32x32x1.
01:31:18: Texture: sdk_separator.png: Loading 1 faces(PF_A8R8G8B8,64x16x1) with 5 generated mipmaps from Image. Internal format is PF_A8R8G8B8,64x16x1.
01:31:18: Texture: sdk_logo.png: Loading 1 faces(PF_A8R8G8B8,128x64x1) with 5 generated mipmaps from Image. Internal format is PF_A8R8G8B8,128x64x1.
01:31:18: Texture: sdk_shade.png: Loading 1 faces(PF_A8R8G8B8,64x48x1) with 5 generated mipmaps from Image. Internal format is PF_A8R8G8B8,64x48x1.
01:31:18: Texture: sdk_frame.png: Loading 1 faces(PF_A8R8G8B8,32x32x1) with 5 generated mipmaps from Image. Internal format is PF_A8R8G8B8,32x32x1.
01:31:18: Texture: sdk_mini_text_box_over.png: Loading 1 faces(PF_A8R8G8B8,32x32x1) with 5 generated mipmaps from Image. Internal format is PF_A8R8G8B8,32x32x1.
01:31:18: Texture: sdk_pulse.png: Loading 1 faces(PF_R8G8B8,8x1x1) with 3 generated mipmaps from Image. Internal format is PF_X8R8G8B8,8x1x1.
01:31:18: Finished parsing scripts for resource group Essential
01:31:18: Parsing scripts for resource group General
01:31:18: Parsing script apache_body.material
01:31:18: Parsing script autoterraintexture.material
01:31:18: Compiler error: number expected in autoterraintexture.material(43): incorrect float constant declaration
01:31:18: Parsing script ball.material
01:31:18: Parsing script capsule.material
01:31:18: Parsing script crate.material
01:31:18: Parsing script door.material
01:31:18: Parsing script gun.material
01:31:18: Parsing script jeep_body.material
01:31:18: Parsing script jeep_wheell.material
01:31:18: Parsing script jeep_wheelr.material
01:31:18: Parsing script kk3d.material
01:31:18: Parsing script landscape.material
01:31:18: Parsing script main_rotor.material
01:31:18: Parsing script plane.material
01:31:18: Parsing script racingcircuit.material
01:31:18: Parsing script scooby_body.material
01:31:18: Parsing script scooby_wheel.material
01:31:18: Parsing script tail_rotor.material
01:31:18: Parsing script target.material
01:31:18: Parsing script zombie.material
01:31:18: Compiler error: reference to a non existing object in zombie.material(9)
01:31:18: Compiler error: reference to a non existing object in zombie.material(21)
01:31:18: Parsing script myExplosion.particle
01:31:18: Parsing script ogreodedemos.particle
01:31:18: Parsing script ogreodedemos.overlay
01:31:18: OGRE EXCEPTION(5:ItemIdentityException): Could not find material Core/StatsBlockCenter in OverlayElement::setMaterialName at ../../../../../OgreMain/src/OgreOverlayElement.cpp (line 330)

dermont

28-11-2011 16:44:25

You probably need to add a path to the OgreCore.zip file in resources.cfg.

[Bootstrap]
Zip=/media/sda7/Libraries/OGRE/ogre-v1-6-4/Samples/Media/packs/OgreCore.zip


I think the zip file is included with OgreOde in demos/Media/packs.

Bruno

29-11-2011 05:03:04

Thanks a lot, it turned out I had added it to resources.cfg but in the group [Popular] instead of [Bootstrap]. I an get past that bit now but now it comes up with a different error when it initializes OIS, which says "terminate called after throwing an instance of 'OIS::Exception' what(): No devices match requested type" OIS should work, I've used it before in Ogre projects, but for some reason it just doesn't seem to want to this time

Had a look around on the forums and a couple of other people had that error too, one of the solved it by plugging in a game controller except I can't do that since I don't have one :P Any ideas what could be causing this?

dermont

29-11-2011 16:16:47

Thanks a lot, it turned out I had added it to resources.cfg but in the group [Popular] instead of [Bootstrap]. I an get past that bit now but now it comes up with a different error when it initializes OIS, which says "terminate called after throwing an instance of 'OIS::Exception' what(): No devices match requested type" OIS should work, I've used it before in Ogre projects, but for some reason it just doesn't seem to want to this time

Had a look around on the forums and a couple of other people had that error too, one of the solved it by plugging in a game controller except I can't do that since I don't have one :P Any ideas what could be causing this?


Probably a bug in the code/mismatch with an updated ExampleApplication/FrameListener. It looks like there is a problem with OIS trying to init (or maybe attempting to initialising twice) your Mouse/KeyBoard/Joystick (????).

I tried the example here on Linux against Ogre 1.8 and it appears to build/work OK. Since your other Ogre projects work with OIS can you not just cut and copy the relevant code? If you can tar up your source/CMake/Make files I'll try building here.

Bruno

01-12-2011 13:43:16

AHA! I finally got that to work, and now I've worked out why the player character kept falling through the ground, it turned out even though I'd scaled up the ground scene node to 5000x bigger, that didn't effect the size of the entity used by ODE. In short, the entity used for checking collisions from was much smaller than the visible ground mesh so when the player moved, even though it looked like they should have been walking on the ground, they were actually walking off the edge :P