Jump to content

Ray picker ignoring some faces


jpvaillancourt
 Share

Recommended Posts

I have a very strange problem with the ray picker. I've been searching online for the past hours and tried so many things. I've checked the vertex normals and the geometry. Everything seems fine.

It seems the ray only pick some faces of my mesh. Always the same ones, so it's not a "collision logic" issue. Every parts of my meshes are correctly UV mapped and they are all merged together.

As you can see on the image, only this part of this mesh seemed to be picked by the ray.

Any idea?

image.png.f7bba990bae9b850ce06fb29722bae63.png

Link to comment
Share on other sites

Hello and welcome ;) (Nice mesh btw)

Can you share a repro in the playground?

Additional questions:

- Is the mesh animated with bones?

- If yes then you cannot pick precisely as the CPU has no idea where the vertices are because they are animated by the GPU

- In this case you may need to provide  an impostor which is not animated (or animated using regular animations)

Link to comment
Share on other sites

  • 2 weeks later...

Thanks for the compliment :)

I have created a playground, and it turns out it was working. I had to build an AssetsManager for our game. Turns out I had a problem with some of my transform since, mesh.parent = X is not the same as mesh.setParent(X).

Still not sure why... I guess there's a manipulation on the transformation matrix on the setParent() method that need to be done.

Link to comment
Share on other sites

Since then I had a texture problem. I checked out another branch on my git and did an "npm install". It started to glitch again.

It seems the problem wasn't fixed with setParent vs .parent, but by updating my npm packages. So I have NO idea what was wrong at first... Maybe a Babylon bug that was fixed.

Probably the same reason why it worked into the playground.

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...