Camera creation requires setWorldGeometry()

sjcomp

01-03-2006 16:24:26

It is not possible to create a camera without previously calling setWorldGeometry(). Assertion fails in

Camera * PagingLandScapeSceneManager::createCamera(const String &name)
{
...
assert (mOptions); // mOptions is instantiated only in setWorldGeometry()
...
}

is it a requirement now to call setWorldGeometry() before creating camera?
CVS HEAD is used.

tuan kuranes

01-03-2006 16:34:44

is it a requirement now to call setWorldGeometry() before creating camera?
It always have been like that.
"Creating a Camera in A World that doesnt't exist" => doesn't make much sense to me...

sjcomp

01-03-2006 18:28:00

Before it was possible to create camera and after that create objects. I used setWorldGeometry when I wanted to display terrain. What would be the configuration file for an empty terrain?

tuan kuranes

01-03-2006 18:40:19

What would be the configuration file for an empty terrain?
That's the idea, if you really need it for menu or whatever, you load an paginglandscape2.cfg with maps but no default map. (defaultmap=none)

sjcomp

02-03-2006 16:52:58

Thanks, tuan kuranes!

I know that I can have multiple maps defined in the single world configuration file. I can switch between them using setOption() with "CurrentMap". The other option would be to have multiple world configuration files, each with DefaultMap set to a particular map.
In the first case all maps have to be define before hand inside the configuration file, while in the second case I can pick configuration files in run-time.

Is it a good idea to have a couple configuration files and make multiple calls to setWorldGeometry()? Or it is not the way setWorldGeometry() should be used in the first place?

Thanks.

tuan kuranes

02-03-2006 17:00:14

Both are ok.
Note that you can add map to the map list at run time using a setoption too.

sjcomp

02-03-2006 21:53:41

Thanks a lot! I will play setoption!

But while we are at it. Can I use Ogre::ResourceGroupManager::getSingleton().addResourceLocation() to add places with the textures and config files for a map that I am adding in run-time using setOption()?

sjcomp

02-03-2006 22:01:06

When I try to use DefaultMap=none I get an assertion in OgrePagingLandScapeTileManager.cpp in

PagingLandScapeTileManager::load()
{
...
assert (!mTiles.empty());
...
}

tuan kuranes

03-03-2006 13:29:13

Can I use Ogre::ResourceGroupManager::getSingleton().addResourceLocation() to add places
yes.
For consistency it should be a setOption too, as it's already an option configurable in Terrain Config File.
(I should really make a framework handling option indifferently from config file or dynamically by setOption...)

When I try to use DefaultMap=none I get an assertion
Sorry, it should be

assert (mOptions->num_tiles <= mTiles.size());

Fixed in CVS.

sjcomp

03-03-2006 20:15:07

Can I use Ogre::ResourceGroupManager::getSingleton().addResourceLocation() to add places
yes.
For consistency it should be a setOption too, as it's already an option configurable in Terrain Config File.

What option do you mean here? In the Terrain Config file I can set what resource group should be used, but not the resource locations themeselves.


Fixed in CVS.

Thanks a lot!

tuan kuranes

03-03-2006 20:34:19

if you have that line in your terrain config
FileSystem=../../../../Samples/Media/paginglandscape2/terrains/LandScapeFileName

it's added to resourcegroupmanger when you load terrain and removed when terrain is unloaded.

sjcomp

03-03-2006 22:00:22

Thanks for explanation. Now I understand what you mean. I have not seen such line in paginglandscape2.cfg, hence the confusion. It is not done yet, because I could not find reference to something like that in setOption() function. I think it would be logical to use setOption(). Though it is achieved as easily by using resource manager directly.

tuan kuranes

04-03-2006 09:15:35

well, thinking of it now... It doesn't seem possible/logical.

The problem is that it change current map resources configuration which would be bad, as setOption is about current map.
And if a map is current, it means it's already loaded... so changing resources group a this moment doesn't seem a good idea...

Only solution is when inserting a new map, to precise the resources in the terrain config file of that new Map.

sjcomp

06-03-2006 20:43:12

Yes you are right. I think using calls to ResourceGroupManager befor setting current map with setOption() is easy, fast and logical.