JeyDotC / construct2-simplethree

Apache License 2.0
1 stars 0 forks source link

Object doesn't actually get removed from the 3D scene after it was destroyed #2

Closed cabfile closed 1 year ago

cabfile commented 2 years ago

So, for example, I have a 3D object that is a wall. Its bind on the J key that it will be destroyed. When I press J, however, it doesn't get destroyed. Or rather, it does, but it still looks like its still here. The only solution that works is first sending the object into the stratosphere infinity (set position to Infinity, Infinity), then destroying it, however, I am creating a game with procedural generation of terrain, and that workaround doesn't even seem to work!

JeyDotC commented 2 years ago

Thanks for the heads up, I'll give it a look, it is pretty likely that I forgot to perform the appropriate object disposal during the game object's remove event.

JeyDotC commented 2 years ago

Ok, after reading the API more carefully, I found out my object disposal functions are totally wrong, I'll try to fix them this week.

cabfile commented 2 years ago

Any progress?

cabfile commented 1 year ago

Aaaany progress?

JeyDotC commented 1 year ago

Hi @cabfile , sorry for the loooong delay, I was in the middle of a project change at my job, which was driving me crazy, lots of things to do. Anyways, here's a preliminary version of the fix, please let me know how it works:

I'll be applying the same cleanup changes to the other projects too.

cabfile commented 1 year ago

Sorry for the very long response as well.... I kinda forgot about this. It works. I made a simple project that creates 3000 3D sprites, and deletes all of them with a press of a button. 99% CPU usage drops to around 3%, and ~24 FPS raises to 60 FPS, meaning it works. Thank you!