I am new to Irrlicht and 3D programming in general and i have been searching Google, Irrforge and these forums for a while and have not quite found what i am looking for. I am wanting to make a seamless world out of all BSP files. Basically i want to load 9 bsp files at once (3x3) with my user in the middle of the grid. As the user moves forward i want to load the 3 BSPs in front of them and "unload/destroy" the 3 behind them. This way the size of my world is only limited by the amount of maps that I can produce.
The best way i can see doing this is by naming all the maps according to their spot on the grid for example:
[map00.bsp] [map01.bsp] [map02.bsp]
[map10.bsp] [map11.bsp] [map12.bsp]
[map20.bsp] [map21.bsp] [map22.bsp]
As a user moved from map11.bsp to map21.bsp we would load map30-32.bsp and "unload/destroy" map00-02.bsp. To do this i need to be able to find out the location of the camera and standardize the size of the maps or find out how to determine the size or edges of a map. Then be able to load the BSPs ahead of the user. I would also like to sometime be able to load buildings from separate bsp files and place them in anywhere in my "world".
If anyone can point me to where i can learn to find out the location of my camera, how i can find out the size of the object in a BSP file, or how i can load more *.bsp on the fly.
Load BSP files on the fly.
Well i answered one of my questions for myself, "How do i find out the location of the camera?"
I really should do some more experiementing before i ask questions. Sorry guys.
Code: Select all
//make the cameraPOS varable.
irr::core::vector3df cameraPOS;
//update the cameraPOS varable
cameraPOS = camera->getPosition();
//get axis POS
cameraPOS.X // The X position
cameraPOS.Y // The Y position
cameraPOS.Z // The Z position
If you want to do this, I suggest having you camera collide with the Bounding box of each loaded section. Each loded section then has a list of other 'sections' that it checks to see if they are loaded, if not load them.
I think The BoundingBox class has a 'Is this point inside of me' type function, I think its called ContainsPoint() or something like that
psudeo code:
something like that.
I think The BoundingBox class has a 'Is this point inside of me' type function, I think its called ContainsPoint() or something like that
psudeo code:
Code: Select all
CAMPOS = Camera->position;
BBOX;
WHILE not all loaded sections(L) in list done
{
BBOX = L->GetBoundingBox();
IF BBOX.ContainsPoint(CAMPOS) THEN
{
GET LIST OF ALL 'SECTORS' LINKED TO THAT SECTOR
WHILE not all listed sectors(s) done
{
LOAD SECTOR s
}
}
}
pushpork
is there some way of loading meshes in irrlicht without slowing doiwn everything... maybe a multi-thread or so?
My Blog: http://www.freakybytes.org