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.
Chaster
OGRE Expert User
Posts: 557 Joined: Wed May 05, 2004 3:19 pm
Location: Portland, OR, USA
Contact:
Post
by Chaster » Thu Dec 04, 2008 2:08 am
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 » Thu Dec 04, 2008 12:22 pm
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
Posts: 557 Joined: Wed May 05, 2004 3:19 pm
Location: Portland, OR, USA
Contact:
Post
by Chaster » Thu Dec 04, 2008 4:46 pm
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 » Thu Dec 04, 2008 5:02 pm
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
Post
by klumhru » Thu Dec 04, 2008 7:56 pm
That worked. Submitted a patch to PagedGeometry forum.
Thanks Chaster!
mKlumhru->getSignature().c_str()
Chaster
OGRE Expert User
Posts: 557 Joined: Wed May 05, 2004 3:19 pm
Location: Portland, OR, USA
Contact:
Post
by Chaster » Sun Dec 07, 2008 4:25 am
No problem. Glad you got it to work!
Chaster
Chaster
OGRE Expert User
Posts: 557 Joined: Wed May 05, 2004 3:19 pm
Location: Portland, OR, USA
Contact:
Post
by Chaster » Tue Dec 16, 2008 10:52 pm
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
jacmoe
OGRE Retired Moderator
Posts: 20570 Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:
Post
by jacmoe » Tue Dec 16, 2008 11:13 pm
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.