typpo / spacekit

Javascript library for 3D space visualizations
https://typpo.github.io/spacekit/
MIT License
527 stars 39 forks source link

addObject() not working #38

Open migbash opened 3 years ago

migbash commented 3 years ago

I have an spaceObject that I store in an array[ ] of spaceObjects, which I use the remove from the simulation upon a button click, an then make the spaceObjects reappear on another button click using the array of spaceObjects and it does not work at all :/

typpo commented 3 years ago

hmm, is there any chance you can provide a jsfiddle as an example?

migbash commented 3 years ago

Yes, so when I try to remove some SpaceObjects() from the Simulation, and then add the same SpaceObjects back in, they do not work. I got them to work by re-creating the createObject() all over again, which I used as a quick hack.

image

, where target_sat contains the SpaceObject object data, & viz is a global defined simulation variable.

And using the viz.addObject() with a SpaceObject object, does not seem to work.