This is G o o g l e's cache of http://www.flashsandy.org/forum/lofiversion/index.php/t424.html as retrieved on 18 Jul 2007 21:37:24 GMT.
G o o g l e's cache is the snapshot that we took of the page as we crawled the web.
The page may have changed since that time. Click here for the current page without highlighting.
This cached page may reference images which are no longer available. Click here for the cached text only.
To link to or bookmark this page, use the following url: http://www.google.com/search?q=cache:fhWj-mi52DYJ:www.flashsandy.org/forum/lofiversion/index.php/t424.html+site:www.flashsandy.org/forum&hl=en&ct=clnk&cd=27


Google is neither affiliated with the authors of this page nor responsible for its content.

Full Version: Reset World feature
zeusprod
It would be nice is there was a "resetWorld" feature that would clean up all the old objects and listeners, and start with a fresh new instance of the world.
Petit
QUOTE(zeusprod @ Mar 27 2007, 07:33 PM) *

It would be nice is there was a "resetWorld" feature that would clean up all the old objects and listeners, and start with a fresh new instance of the world.

Couldn't you just drop the old and dirty world, and create a new brave world?
I'm after the delete and destroy approach cool.gif
zeusprod
QUOTE(Petit @ Mar 27 2007, 05:38 PM) *

Couldn't you just drop the old and dirty world, and create a new brave world?
I'm after the delete and destroy approach cool.gif



Well, it isn't as obvious as it sounds. Someone has to tweak the classes to destroy the containing clip and the Singleton _inst.

These aren't exposed in the current version.

I worked out some hacks, but I'm hesitant to post them to the repository, because they are probably not cleaning up completely. My brave new world seems considerably slower than the old dirty one.
kiroukou
Hi Bruce,
Are you talking about the 1.2 ?

Is the Worl3D.getInstance().getRootNode().destroy() not working as you expect?
zeusprod
QUOTE(kiroukou @ Mar 28 2007, 10:33 AM) *

Hi Bruce,
Are you talking about the 1.2 ?

Is the Worl3D.getInstance().getRootNode().destroy() not working as you expect?



Thanks for the information. I hadn't tried that. I'll let you know if it works.

Does that put it in a state where I have to set the rootGroup again and invoke World3D.render?

In other words, what state is the world left in when you destroy the rootNode?

I've been unable to destroy individual objects in the world the way I was able to do in 1.1, so that is why I was looking for a way to destroy the entire world.


Bruce
Entragan

I have the same problem. The 'World3D.getInstance().getRootNode().destroy()' did not work. I'm even looping through all the childs in the rootgroup and both destroy and remove them. Afterwards I destroy and remove the root group.

Still, Everytime I create a new world is twice as slow as the previous one..


CODE

        trace("disposing");
        
        var objects:Array = rootGroup.getChildList();
        for (var i:Number=0; i<objects.length; i++) {
            
            objects[i].destroy();
            objects[i].remove();
            
        }
        
        rootGroup.destroy();
        rootGroup.remove();
        
        screen.dispose();
        
        World3D.getInstance().stop();
        
        World3D.getInstance().getRootNode().destroy()
zeusprod
In Sandy 1.2, I think it is getRootGroup() not getRootNode();

such as:

World3D.getInstance().getRootGroup().destroy();

I haven't tried it yet but that should work better than getRootNode!
Entragan
the strangest thing.. I've made the whole 3d world as an external swf, so that I can unload it when I have to build a new world.. but the problem remains!

it's not a texture thing, because I removed all textures as a test ofcourse

I've tried to port to 1.2, but then things didn't work and I wasn't able to get it to work. Got all kinds of errors for ClipScreen class also..

running out of options :s
Petit
QUOTE(Entragan @ May 18 2007, 04:13 PM) *

I've tried to port to 1.2, but then things didn't work and I wasn't able to get it to work. Got all kinds of errors for ClipScreen class also..

Well, if you're trying to port to 1.2, you shouldn't be too fast.
There are FAQ's about that under "Sandy 1.2 issues".
Among other things discussed is the fact that ClipScreen is no longer used in 1.2.

For the original problem, I haven't got a clue ( so far smile.gif)
Entragan
I'm a lot further now. Best practice for this problem (at least in Sandy 1.1) seems not to cleanup the world, but just stop rendering it, make the clipscreen invisible and make it visible and start rendering again when needed.

I just ran into another funny thing while re-applying textures to an object (both via faces and setskin). The textures are not correct when reapplyed to the object, so I had to remove the object and place a new one.
Petit
QUOTE(Entragan @ May 20 2007, 10:31 AM) *

I just ran into another funny thing while re-applying textures to an object (both via faces and setskin). The textures are not correct when reapplyed to the object, so I had to remove the object and place a new one.

Sounds strange. Would you have any code to demo the problem?
Entragan
QUOTE(Petit @ May 20 2007, 11:59 AM) *

Sounds strange. Would you have any code to demo the problem?


Well, whaddayouknow? I tried to recode this bug.. but couldn't! The problem was solved because I had to rewrite the routine, so I thought to quickly put the bug back in and paste the code here.. I must have made a mistake with the texture indexes I use.. (I created a TextureManager that loads all jpegs upfront and holds an object with id's. On creating the Object3D's I also create an array which holds references to those objects and their positions, translations, etc. and the id's of the appropriate textures in the TextureManager)

As soon as this project is done I'll put some sources up here. Can't do that at the moment, for the website it's for is not live yet and I think our (big and paying) customer wouldn't appreciate ;-)

by the way, your extensive tutorials gave me a very good kickstart to understanding Sandy. So thanks a lot for that!
Petit
QUOTE(Entragan @ May 20 2007, 06:23 PM) *

Well, whaddayouknow? I tried to recode this bug.. but couldn't!

by the way, your extensive tutorials gave me a very good kickstart to understanding Sandy. So thanks a lot for that!

Well, for once a really lucky programmer, who cannot find a way to reintroduce a bug laugh.gif
Thanks for your kind words!

Looking forward to see the final results.
good luck!
Entragan
QUOTE(Petit @ May 20 2007, 06:40 PM) *

Looking forward to see the final results.
good luck!


it's finaly live for netherlands! Sandy is awaiting behind the round button!
www.eamostwanted.nl

I must say I'm very impressed with the great performance Sandy delivers. Even on a mac! ;-)
Petit
QUOTE(Entragan @ Jun 8 2007, 08:43 AM) *

it's finaly live for netherlands! Sandy is awaiting behind the round button!
www.eamostwanted.nl
I must say I'm very impressed with the great performance Sandy delivers. Even on a mac! ;-)

Quite an impressive site design too blink.gif
Thanks!
kiroukou
Really good !!

It is fast here, on a MAC too wink.gif Good one!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2007 Invision Power Services, Inc.