The Portal Connected Zone Scene Manager: SVN Version
-
- OGRE Expert User
- Posts: 557
- Joined: Wed May 05, 2004 3:19 pm
- Location: Portland, OR, USA
- Contact:
Update: After Sinbad tweaked a minor setting, I was able to upload my changes.
What did I change? Well, a couple things:
1) I significantly changed the Portal code so that now Portals can take 3 forms: planar quad, axis aligned box (AABB), and sphere. The AABB and Sphere portals are for enclosing "subzones" which don't have enclosing geometry. (for example, you could encapsulate a planet as a zone and surround it with a spherical portal). The AABB and Sphere portals provide gross culling and scenenode transitioning between the zone "inside" and the zone "outside" the portal. They do not add an culling planes to the frustum though. Important Note: while it is technically supported, it is not recommended that zones enclosed in AABB or Sphere portals move through other portals. The code for doing so is quite crude, and might not work in some situations.
2) I fixed a bug which caused a crash when one zone crossed into another zone. This bug was not detected until now because I had not created a scene where a zone moved into another zone. It should work now.
Let's call this version 1.2.
Chaster
What did I change? Well, a couple things:
1) I significantly changed the Portal code so that now Portals can take 3 forms: planar quad, axis aligned box (AABB), and sphere. The AABB and Sphere portals are for enclosing "subzones" which don't have enclosing geometry. (for example, you could encapsulate a planet as a zone and surround it with a spherical portal). The AABB and Sphere portals provide gross culling and scenenode transitioning between the zone "inside" and the zone "outside" the portal. They do not add an culling planes to the frustum though. Important Note: while it is technically supported, it is not recommended that zones enclosed in AABB or Sphere portals move through other portals. The code for doing so is quite crude, and might not work in some situations.
2) I fixed a bug which caused a crash when one zone crossed into another zone. This bug was not detected until now because I had not created a scene where a zone moved into another zone. It should work now.
Let's call this version 1.2.
Chaster
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
- Lee04
- Minaton
- Posts: 945
- Joined: Mon Jul 05, 2004 4:06 pm
- Location: Sweden
- x 1
??scenenode transitioning between the zone "inside"
I don't understand this point fully??? Can you explain more?
Thanks
Lee
Where can I get hold of this version?scenenode transitioning between the zone "inside" and the zone "outside" the portal. They do not add an culling planes to the frustum though.
Thanks
Lee
Ph.D. student in game development
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
He means it handles transferring of nodes between zones based on them crossing the threshold of that AABB / sphere, but that when rendering 'through' them, there is no reduction in the size of the frustum rendered, which makes sense because they're not enclosed by occluding geometry.
You can get it by using CVS HEAD.
You can get it by using CVS HEAD.
-
- OGRE Expert User
- Posts: 557
- Joined: Wed May 05, 2004 3:19 pm
- Location: Portland, OR, USA
- Contact:
-
- OGRE Expert User
- Posts: 557
- Joined: Wed May 05, 2004 3:19 pm
- Location: Portland, OR, USA
- Contact:
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
I've only played with your sample so far but I have definite plans to do more in the future. It's dependent on me finishing a considerable amount more work on my own project before I can really give it a proper going over outside your demo. My comments from before stand, I think you've done a really good job especially considering that the original SceneManager structure wasn't designed to function this way originally.
- xavier
- OGRE Retired Moderator
- Posts: 9481
- Joined: Fri Feb 18, 2005 2:03 am
- Location: Dublin, CA, US
- x 22
- jacmoe
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
PCZSM is on my immediate list of things to try. 
Considering that it is the future of Ogre scene management, apparently.

Considering that it is the future of Ogre scene management, apparently.

/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
- steven
- Gnoll
- Posts: 657
- Joined: Mon Feb 28, 2005 1:53 pm
- Location: Australia - Canberra (ex - Switzerland - Geneva)
- Contact:
- Lee04
- Minaton
- Posts: 945
- Joined: Mon Jul 05, 2004 4:06 pm
- Location: Sweden
- x 1
Yes I will surly try it.
I think it's important to try to use it.
I want to see if I can combine other peoples work to it as well.
Lee04
I want to see if I can combine other peoples work to it as well.
Lee04
Ph.D. student in game development
-
- Gnoblar
- Posts: 18
- Joined: Thu May 10, 2007 8:59 am
-
- Gnoblar
- Posts: 18
- Joined: Thu May 10, 2007 8:59 am
Well, I'm just playing around a bit with it (it's great by the way
) but I'm running into trouble every time I terminate my app:
When the SceneManager get's destroyed he clears the scene a last time. But then (at the end of clearScene) he attempts to reinitialisize himself - creating the std-zone and so on. The problem is, that he just deleted all the factories... so it throws an exception. Maybe it would be possible to first clear the scene and then delete the zone-factories?
Jan

When the SceneManager get's destroyed he clears the scene a last time. But then (at the end of clearScene) he attempts to reinitialisize himself - creating the std-zone and so on. The problem is, that he just deleted all the factories... so it throws an exception. Maybe it would be possible to first clear the scene and then delete the zone-factories?
Jan
-
- OGRE Expert User
- Posts: 557
- Joined: Wed May 05, 2004 3:19 pm
- Location: Portland, OR, USA
- Contact:
Hmm, I wonder why you are running into this issue but nobody else is (or at least, nobody else has mentioned this..) I suppose one solution would be to eliminate the re-initialization call in clearScene() but then the user would have to be sure to always call init() manually after he/she called clearScene() ... Still, that doesn't answer the niggling question about why it works for me but not you 'as is'...Lino wrote:Well, I'm just playing around a bit with it (it's great by the way) but I'm running into trouble every time I terminate my app:
When the SceneManager get's destroyed he clears the scene a last time. But then (at the end of clearScene) he attempts to reinitialisize himself - creating the std-zone and so on. The problem is, that he just deleted all the factories... so it throws an exception. Maybe it would be possible to first clear the scene and then delete the zone-factories?
Jan
Chaster
-
- Gnoblar
- Posts: 18
- Joined: Thu May 10, 2007 8:59 am
Mh... Will do a little testing 
Well, found the bug -but don't understand it:
In Debug I checked the value of FACTORY_TYPE_NAME and it's "". But don't ask me why...

Well, found the bug -but don't understand it:
Code: Select all
const String DefaultZoneFactory::FACTORY_TYPE_NAME = "ZoneType_Default";
bool DefaultZoneFactory::supportsPCZoneType(const String& zoneType)
{
if (DefaultZoneFactory::FACTORY_TYPE_NAME == zoneType)
{
return true;
}
return false;
}
-
- OGRE Expert User
- Posts: 557
- Joined: Wed May 05, 2004 3:19 pm
- Location: Portland, OR, USA
- Contact:
Looks like memory corruption to me... I'll make a mental note to check this out on my system, but the code is pretty plain and I'll be surprised if I can duplicate your problem...Lino wrote:Mh... Will do a little testing
Well, found the bug -but don't understand it:In Debug I checked the value of FACTORY_TYPE_NAME and it's "". But don't ask me why...Code: Select all
const String DefaultZoneFactory::FACTORY_TYPE_NAME = "ZoneType_Default"; bool DefaultZoneFactory::supportsPCZoneType(const String& zoneType) { if (DefaultZoneFactory::FACTORY_TYPE_NAME == zoneType) { return true; } return false; }
Chaster
-
- Gremlin
- Posts: 156
- Joined: Thu May 17, 2007 10:56 pm
Are you accessing it through a pointer to PCZoneFactory (vs. DefaultZoneFactory)? The reason I ask is because DefaultZoneFactory inherits from PCZoneFactory and they both have a static member named FACTORY_TYPE_NAME. I really don't know how c++ deals with that and pointers to base classes since data members != virtual functions.Lino wrote:Mh... Will do a little testing
Well, found the bug -but don't understand it:In Debug I checked the value of FACTORY_TYPE_NAME and it's "". But don't ask me why...Code: Select all
const String DefaultZoneFactory::FACTORY_TYPE_NAME = "ZoneType_Default"; bool DefaultZoneFactory::supportsPCZoneType(const String& zoneType) { if (DefaultZoneFactory::FACTORY_TYPE_NAME == zoneType) { return true; } return false; }
Edit: actually I don't even know if that makes sense since they are static members. Point is... make sure you're looking at DefaultZoneFactory's version instead of PCZoneFactory's.
-
- OGRE Expert User
- Posts: 557
- Joined: Wed May 05, 2004 3:19 pm
- Location: Portland, OR, USA
- Contact:
Hmmm, perhaps my lack of C++ expertise may be biting me here... I have each subclass of PCZone (DefaultZone, OctreeZone, TerrainZone) each declare it's own version of:
In each zones' factory implementation source file, I define them uniquely like so:
or
I was/am under the impression that this is allowed in C++ and would return the correct FACTORY_TYPE_NAME as needed. Is this a bad assumption? It seems to work fine for me..
Chaster
Code: Select all
static const String FACTORY_TYPE_NAME;
Code: Select all
const String DefaultZoneFactory::FACTORY_TYPE_NAME = "ZoneType_Default";
Code: Select all
const String OctreeZoneFactory::FACTORY_TYPE_NAME = "ZoneType_Octree";
Chaster
- tau
- Silver Sponsor
- Posts: 413
- Joined: Wed Feb 11, 2004 11:44 am
- Location: Austin (that's kept wierd :))
I think Static is shared among all the class instances and the inherited classes 
Do you really need it to be static?

Do you really need it to be static?
Twitter: Tau Powered
- Praetor
- OGRE Retired Team Member
- Posts: 3335
- Joined: Tue Jun 21, 2005 8:26 pm
- Location: Rochester, New York, US
- x 3
- Contact:
Yeah, I think tau is right. You could just do a standard old virtual method like:
virtual Ogre::String getFactoryName() const = 0;
It should allow for overriding like you need with few drawbacks. Not even performance is a problem. I can't imagine this method being called often.
virtual Ogre::String getFactoryName() const = 0;
It should allow for overriding like you need with few drawbacks. Not even performance is a problem. I can't imagine this method being called often.
Game Development, Engine Development, Porting
http://www.darkwindmedia.com
http://www.darkwindmedia.com
-
- Gnoblar
- Posts: 18
- Joined: Thu May 10, 2007 8:59 am
-
- OGRE Expert User
- Posts: 557
- Joined: Wed May 05, 2004 3:19 pm
- Location: Portland, OR, USA
- Contact:
-
- OGRE Expert User
- Posts: 557
- Joined: Wed May 05, 2004 3:19 pm
- Location: Portland, OR, USA
- Contact:
Fixed. Will be in next CVS update I do.Lino wrote:Something on compiling on Linux:
-> Little typing error: OgreSubmesh.h has to be OgreSubMesh.h
Sorry, I just don't have the time/resources to maintain multiple platform/tool project files..-> Simply importing of VStudio-Projectfile with CodeBlocks worked, but the filenames had to adjusted (for example slashes instead of backslashes), so a Linux-Codeblocks-Projectfile would be nice
Jan