|
| hi!
I have another 2 problems: the first is how to fully preload my world.
Now I'm trying to do it as follows:
DEF PreloadWorld Script {
field SFNode myself USE PreloadWorld
field SFNode loading USE LoadingText
field MFNode world []
eventIn MFNode WorldLoaded
eventOut SFTime startTimer
eventIn SFBool timerStopped
url "java script:
function initialize()
{
loading.string[0] = 'Trwa \xC5\x82adowanie...';
Browser.createVrmlFromURL('wszystko.wrl',myself,'WorldLoaded');
}
function WorldLoaded(newWorld, time)
{
world = newWorld;
startTimer = time;
}
function timerStopped(value, time)
{
if (value==0)
Browser.replaceWorld(world);
}
"
}
ROUTE PreloadWorld.startTimer TO delayTimer.startTime
ROUTE delayTimer.isActive TO PreloadWorld.timerStopped
so - I use function createVrmlFromURL to load it. But it wasn't enough
so I added some delay. It wasn't enough because when the loaded world
finally showed up, it still wasn't complete :/
I thought that createVrmlFromURL would end, when everything's loaded but
it seems it ends earlier.
But maybe it's related to my other problem - I have many Inlines in my
world. About 150 files are inlined. I don't define any bounding boxes in
inlines, because I think that it'll make browser load all inlines as
soon as possible to find out how big an object is.
Anyway - Inlines are good, but downloading many small files is slower
than downloading one big (around 200kB) file. Inlines are good (IMO)
when developing a world... So - i was trying to replace inlines with
their real content. Chisel is supposed to do it, but it produces many
erors (especially with PROTOs). Are there any other tool that'd do it?
And btw - I have sth like:
loading.string[0] = 'Trwa \xC5\x82adowanie...';
As far as i know I should use sth like
loading.string[0] = new SFString('Trwa \xC5\x82adowanie...');
So why my method works??
TIA
md
|
|