MackeyK24 Posted December 11, 2016 Share Posted December 11, 2016 How do we define the size of our collision box (i goes would be the same for camera and physics)... Do we use mesh.ellipsoid and mesh.ellipsoidOffset to actual define our collision bound box ??? Don't seem to see a mesh.collisionRect or anything like that. I am trying to emulate the BOX and CAPSULE collider functionality in unity where you drag the "collider rect" to define size of collision box or capsule. I would then like to store those values on my node.metadata and use those to "DEFINE" the babylon.mesh collision rect Quote Link to comment Share on other sites More sharing options...
RaananW Posted December 12, 2016 Share Posted December 12, 2016 mesh.ellipsoid is your friend This is where you define the collision box, for example for the camera. Pay attention that camera collision inspection (for example) will ignore the mesh's ellipsoid definitions and will use the mesh's vertices instead to check Box-to-mesh collision. This is why you can walk on surfaces. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 12, 2016 Share Posted December 12, 2016 FOr collisions (and not physics) we use an ellipsoid define on the camera (camera.ellipsoid). It is a "pure" collision meaning that the mesh data is used to determine collision. If you want to emulate box or capsule collider, just emit an invisible box or capsule mesh (with parent set to original mesh and with setVisible(false) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.