Sign in to follow this  
jellix

cylindrical impostor should be collidable from inside

Recommended Posts

Hi,

a collision with a cylindrical imposter is only triggered when my "bullet" hits the outer surface of the impostor.

But my bullet should collide on the inside of the cylinder.

I've used "flipFaces()" with the mesh that the impostor is used on without an effect.

... is my question clear so far?

Share this post


Link to post
Share on other sites

Hi Jelix

You can get that with a CannonJS meshImpostor, but might not be possible with a cylinderImpostor.

http://www.babylonjs-playground.com/#1YOCO9#34

AND, only spheres collide with CannonJS meshImpostors.

Others may comment and have better ideas.

Notice the setPhysicsState on a setEnabled(false) cylinder?  Notice that when you enable 'cyl', you can't see it... thru the wireframe cyl2 (even though the wireframe cyl2 is scaled larger)?

It's all part of the magic... of BJS :)

Share this post


Link to post
Share on other sites

You can use bouding box states for this as well to see if an object is contained.  Also I'm not sure but I think if you flip the.l normals of the object it should treat it like a container.  Don't quote me on that though.

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.