Couple of Random Questions to finish setting up PCZSM


17-11-2009 11:16:43

First off, I really appreciate the help getting my project running, I spent days looking through code only to realize I was missing the OctreeZone plugin. Anyways, I have a couple of questions that have come up that I am hoping to get answered if possible.

1) Right now my character is floating above the terrain when I start the game. I am assuming this is because hes in the Default Zone instead of the Terrain Zone I created, but how exactly do I assign him to the new zone? I tried just doing something like this but it didnt make any difference. Also, im curious since I use a third person camera, is that going to cause problems when my character mesh crosses over a portal before my camera does (or vice versa)?

Ogre::PCZSceneManager *pczSM = (Ogre::PCZSceneManager*)sceneMgr;
Entity *ent = pczSM->createEntity("Entity_"+name, meshName);

2) I read on the wiki everything needs to be given a scene node and assigned to the zone. Right now I keep a global singleton pointer to root, scene manager, etc in my header file. When I create the Scene nodes do I need to make them with the PCZSceneManager? I was confused on this as it seemed from the demo apps they created the camera and so on using the generic SceneManager.

3) This is mostly just a learning project, but my goal is to come up with a game world similar that of WoW, where the world is very open. I want to do towns and dungeons and what not as well as the terrain, so I assume PCZSM is my best bet for this. Can DotScene's be loaded and connected to terrain, or is it best just to go completely with one or the other? My plan is to use scene's, but if I can use them together that might make life easier.


20-11-2009 00:57:05

In the code you posted you are only creating the entity. The entity must be attached to a SceneNode (SceneNode or PCZSceneNode) and then you can add that specific node to a specific zone with:
addPCZSceneNode(PCZSceneNode*, PCZone*);

But simply doing that will not make your mesh stand on the terrain, you'll need to use the getHeightAt function to find the terrain height at a specific location or implement a physics/collision engine.

We use a 3rd person camera with portals and have not had any issues.