pwetpwet Posted April 15, 2014 Share Posted April 15, 2014 Hello, I created a scene (with blender) composed of cubes and a map (plan). I checked "enable collisions" for all my objects and only put a mass to my cubes. But I have a problem in blender I can't choose "mesh" for my plan to export otherwise it create me an error, so I have to export it as a box. But in box mode, if my cube is outside the map (the map is pierced in the middle), the cube stops falling anyway because I chose the box mode. I read that there was a notion of precision, but I did not find in blender. Thank you for your help. I work with blender 1.68a and Babylon.js 1.10.An example to my problem:https://dl.dropboxusercontent.com/u/48211107/babylonjsBlender.rar Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 15, 2014 Share Posted April 15, 2014 Beware: collisions are related to camera (first person) collisions You need physics in your case I think. If you want your box to fall, you have to give it a mass. Without mass, it will be static (but still physic) Quote Link to comment Share on other sites More sharing options...
pwetpwet Posted April 16, 2014 Author Share Posted April 16, 2014 Physics and mass work fine, cubes fall on the map. Like this: But when he fall, the collisions are detected like a box for my plan, because I select "box" in shape property.The "mesh" or "converx hull" in shape property make an error when I export blender to babylon. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 16, 2014 Share Posted April 16, 2014 Oh yes. Right now we only support (due to cannon.js) box, plane and sphere Quote Link to comment Share on other sites More sharing options...
pwetpwet Posted April 16, 2014 Author Share Posted April 16, 2014 Oh ok! To try babylon.js, I have thinking to create a little car game.In my example, the cube will be the car. Do you think it's possible? If collision detect only box, plane and sphere, I think I have a big problem, because the solution is to make a walls on my map , but the wall can't be a box,plane or sphere too , they are round. And I think the car will be on the wall if the map is like a cube too. Futhermore, I don't know how to know if the cube is on the map.The fonction IsIntersect() will give me the same problem with collisions? Thank you very much for all of your answers. Quote Link to comment Share on other sites More sharing options...
Artem Posted April 16, 2014 Share Posted April 16, 2014 Just 'draw' all the collision using boxes through the path, you can go with round walls using boxes as well (just place them that way); probably not the best solution by far, but that's an option, I think. If I were you I would write my own physics rules. Yeah, that's a pain, but that would be much better than using boxes as walls everywhere. Just my opinion here, not even a tip Quote Link to comment Share on other sites More sharing options...
pwetpwet Posted April 18, 2014 Author Share Posted April 18, 2014 I undestand, thank you. I will try all of your options. Quote Link to comment Share on other sites More sharing options...
pwetpwet Posted April 20, 2014 Author Share Posted April 20, 2014 Hello, I have create a square map in "block"(multi box) to make an easy map, it's not funny to design with blender but it's work. Secondly, I have try to move a cube in the runRenderLoop function with for example:mesh.position.y +=0.1;But the position don't change, the position stay in the absolute position. It is normal? Maybe babylon.js have I option to stay in the absolute position? Thx you. Quote Link to comment Share on other sites More sharing options...
Artem Posted April 20, 2014 Share Posted April 20, 2014 When you use physical objects you can't move them just like that (at least I don't know how at moment), but you can apply some force to them, or (even better) place your box on a sphere (make a group) and then make a motor from sphere (or just rotate it, I don't know, didn't played much with it). I think you need to take some closer look at cannon.js, also you can try motor function or 'applyForce', or 'applyImpulse'. Just my thoughts, but that should help you with your project there. Good luck, pwetpwet 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.