Jump to content

how to call a mesh


OXY11
 Share

Recommended Posts

I have a SPS and when I hit a particle with mouse I clone a mesh "imgThumb", and I give her the ID using particle idx:

var newThumb = imgThumb.clone("thumb");

newThumb.id = particle.idx; 

 

but I'm not able to dispose this mesh, this doesn't work:

var deleteThumb  = function (particle) {
                    getMeshById(particle.idx).dispose();
        }

 

 

Link to comment
Share on other sites

Hiya Oxy11, and welcome.  I see a few issues.  getMeshById(particle.idx) is unlikely to work correctly.   For clicked particle, scene.getMeshById("id") is not the same as SPS.particles[idx].  Maybe try SPS.particles[idx].dispose();  ??

Would you be willing to modify (and make some more SAVES-of) this playground demo to reproduce the issue?  It is easier for everyone to work-on... when there is a playground demo.  :)  thx!  

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...