jpvaillancourt

Ray picker ignoring some faces

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

Share this post


Link to post
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)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.