The Portal Connected Zone Scene Manager: SVN Version

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
Locked
Chaster
OGRE Expert User
OGRE Expert User
Posts: 557
Joined: Wed May 05, 2004 3:19 pm
Location: Portland, OR, USA
Contact:

Post by Chaster »

By the way, does anyone have a handy snippet for a heightfinder for PCZSM?
TerrainZone.cpp has a "getHeight()" function.

Note that this is only for TerrainZones. getHeight() doesn't make much sense in other zone types.

Chaster
klumhru
Kobold
Posts: 29
Joined: Thu Mar 27, 2008 12:14 pm

Post by klumhru »

Sorry, I thought I had included this code in the above post:

Code: Select all

	mSceneMgr = (PCZSceneManager*) mRoot->createSceneManager("PCZSceneManager", "PCZSceneManager");
	mSceneMgr->init("ZoneType_Default");

	mCam = mSceneMgr->createCamera(String("PlayerCamera"));
	mNode = (PCZSceneNode*) mSceneMgr->getRootSceneNode()->createChildSceneNode("CameraNode");
	mNode->attachObject(mCam);
	mNode->setFixedYawAxis(true);
	mCam->setNearClipDistance(2);
	mCam->setFarClipDistance(1000);

	((PCZSceneNode*)mCam->getParentSceneNode())->setHomeZone(mSceneMgr->getDefaultZone());

	mVp = mRoot->getAutoCreatedWindow()->addViewport(mCam);

	mInput = new InputHandler(mRoot->getAutoCreatedWindow());
	mInput->setCameraNode(mNode, ConfigurationManager::getSingletonPtr()->getPlayerOptions()->MouseSensitivity);
The (PCZSceneNode*) cast is just an experiment I did, same thing happens without casting it and the mNode is just a regular SceneNode*
mKlumhru->getSignature().c_str()
Chaster
OGRE Expert User
OGRE Expert User
Posts: 557
Joined: Wed May 05, 2004 3:19 pm
Location: Portland, OR, USA
Contact:

Post by Chaster »

A couple thoughts occur to me:

1) If mNode is a regular SceneNode, and not a PCZSceneNode, I think you will be losing the PCZSceneNode-specific members...

2) PagedGeometry may be using it's own camera to create those impostors. If it is, you'll have to go in and modify the PagedGeometry code itself to make sure that the "hidden" camera (if there is one) is also set up properly to work with PCZSM.

Chaster
klumhru
Kobold
Posts: 29
Joined: Thu Mar 27, 2008 12:14 pm

Post by klumhru »

Ah, I'll check the PG camera code.

I had tried with both PCZSceneNode and SceneNode, same deal.

EDIT:
Downloaded the PG source at work and it seems like its not hanging the impostor rendering camera onto a node. I'll test that when I get home.

from PG:

Code: Select all

	//Set up camera
	renderCamera = sceneMgr->createCamera(getUniqueID("ImpostorCam"));
	renderCamera->setLodBias(1000.0f);
	renderViewport = renderTarget->addViewport(renderCamera);
	renderViewport->setOverlaysEnabled(false);
	renderViewport->setClearEveryFrame(true);
	renderViewport->setShadowsEnabled(false);
	renderViewport->setBackgroundColour(ImpostorPage::impostorBackgroundColor);
	
	//Set up scene node
	SceneNode* node = sceneMgr->getSceneNode("ImpostorPage::renderNode");
	
	Ogre::SceneNode* oldSceneNode = entity->getParentSceneNode();
	if (oldSceneNode) {
		oldSceneNode->detachObject(entity);
	}
	node->attachObject(entity);
	node->setPosition(-entityCenter);
mKlumhru->getSignature().c_str()
klumhru
Kobold
Posts: 29
Joined: Thu Mar 27, 2008 12:14 pm

PCZSM Portal Connected SceneManager forests JohnJ crash

Post by klumhru »

That worked. Submitted a patch to PagedGeometry forum.

Thanks Chaster!
mKlumhru->getSignature().c_str()
Chaster
OGRE Expert User
OGRE Expert User
Posts: 557
Joined: Wed May 05, 2004 3:19 pm
Location: Portland, OR, USA
Contact:

Post by Chaster »

No problem. Glad you got it to work!

Chaster
Chaster
OGRE Expert User
OGRE Expert User
Posts: 557
Joined: Wed May 05, 2004 3:19 pm
Location: Portland, OR, USA
Contact:

Post by Chaster »

NOTICE: There is a new subforum in the Addons Forum for the PCZSceneManager. Please direct all inquiries to that forum as I will be focusing my monitoring there instead of here.

Chaster
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

/* Redirect to the PCZ SceneManager Forum*/
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Locked