Cris Posted September 20, 2016 Share Posted September 20, 2016 hi all, I use BABYLON.SceneLoader to load a maze scene with many walls, and also import a spider robot to this scene. But when I want to use moveWithCollision method to control robot moving, it's not work. Robot will cross the wall and not detect collision. If I create a scene manually and create many box instead of walls, the moveWithCollision method has worked. I'm sure all wall's checkCollisions property is true...kindly suggest me for this Quote Link to comment Share on other sites More sharing options...
webGLmmk Posted September 20, 2016 Share Posted September 20, 2016 2 hours ago, Cris said: hi all, I use BABYLON.SceneLoader to load a maze scene with many walls, and also import a spider robot to this scene. But when I want to use moveWithCollision method to control robot moving, it's not work. Robot will cross the wall and not detect collision. If I create a scene manually and create many box instead of walls, the moveWithCollision method has worked. I'm sure all wall's checkCollisions property is true...kindly suggest me for this Hi Cris, Can you post a playground scene? i know you're importing a scene... (from blender maybe?)...but if you have the exported file on github, you can easily use the raw github url to import it into the playground.. http://www.babylonjs-playground.com/#1UQADD#0 wrote a brief tutorial on getting your assets to show in the playground https://github.com/3dwebgs/miscWebGLpages/blob/master/babylondoc.md Even if you don't use git, you can still create a github account, its convenient for so many things. The best way you can help yourself here is to get some practice getting your code into a playground scene, so you can demonstrate your question to the forum. It helps everyone else help you by seeing your code. Quote Link to comment Share on other sites More sharing options...
Cris Posted September 20, 2016 Author Share Posted September 20, 2016 18 minutes ago, webGLmmk said: Hi Cris, Can you post a playground scene? i know you're importing a scene... (from blender maybe?)...but if you have the exported file on github, you can easily use the raw github url to import it into the playground.. http://www.babylonjs-playground.com/#1UQADD#0 wrote a brief tutorial on getting your assets to show in the playground https://github.com/3dwebgs/miscWebGLpages/blob/master/babylondoc.md Even if you don't use git, you can still create a github account, its convenient for so many things. The best way you can help yourself here is to get some practice getting your code into a playground scene, so you can demonstrate your question to the forum. It helps everyone else help you by seeing your code. Thank you for your help! Forgive me careless, here is my demo. My scene model is export from blender. http://www.babylonjs-playground.com/#1UQADD#2 press key 'z' to move cube Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 20, 2016 Share Posted September 20, 2016 @webGLmmk: your doc is COOL. Why not integrating it in our documentation site? https://github.com/BabylonJS/Documentation Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 20, 2016 Share Posted September 20, 2016 Hey Cris... try this one... http://www.babylonjs-playground.com/#1UQADD#4 Line 39 area. You forgot to set .checkCollisions on the player itself. Everything else... was perfect... and I had a few minutes of fun driving around Mister Box. Successful game by Cris... #1. Many more to come, I predict. Hope this helps. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 20, 2016 Share Posted September 20, 2016 @WingnutYou are getting better than me at problem fixing !! Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 20, 2016 Share Posted September 20, 2016 Thx, but... whomever wrote this "BJS" engine... made it easy. i know the guy a little... he taught me about keeping things out-of continuous collision, taught me about ellipsoid sizing, taught me about... oh, just a ton of stuff about the BJS built-in collision system. He's a great guy... I'll introduce him to you, someday. I think he's from Texas. heh Quote Link to comment Share on other sites More sharing options...
Cris Posted September 21, 2016 Author Share Posted September 21, 2016 13 hours ago, Wingnut said: Hey Cris... try this one... http://www.babylonjs-playground.com/#1UQADD#4 Line 39 area. You forgot to set .checkCollisions on the player itself. Everything else... was perfect... and I had a few minutes of fun driving around Mister Box. Successful game by Cris... #1. Many more to come, I predict. Hope this helps. Thank for your help! I have fixed my bugs! Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 21, 2016 Share Posted September 21, 2016 Good deal. Our pleasure. I did some more experiments on your scene. http://www.babylonjs-playground.com/#1UQADD#5 I added a green sphere... so I could "see" the meshPlayer.ellipsoid... trying to test some things. Not sure what I broke or how it is broken, but I broke something. Lots of reporting to console... checking meshPlayer.ellipsoid sizes. Numbers look good, but... player nav has troubles. Green sphere falls too deep into floor, and player goes under walls, etc. Just a mess. Way to go, Wingnut! Quote Link to comment Share on other sites More sharing options...
Cris Posted September 22, 2016 Author Share Posted September 22, 2016 5 hours ago, Wingnut said: Good deal. Our pleasure. I did some more experiments on your scene. http://www.babylonjs-playground.com/#1UQADD#5 I added a green sphere... so I could "see" the meshPlayer.ellipsoid... trying to test some things. Not sure what I broke or how it is broken, but I broke something. Lots of reporting to console... checking meshPlayer.ellipsoid sizes. Numbers look good, but... player nav has troubles. Green sphere falls too deep into floor, and player goes under walls, etc. Just a mess. Way to go, Wingnut! Actually, I found that if two mesh that has been set checkCollisions property to true overlap together, the moveWithCollision function will not work. In my first example, the cube has overlaped with ground too. Or did I missed something ? Quote Link to comment Share on other sites More sharing options...
webGLmmk Posted September 22, 2016 Share Posted September 22, 2016 On 9/19/2016 at 11:18 PM, Cris said: Thank you for your help! Forgive me careless, here is my demo. My scene model is export from blender. http://www.babylonjs-playground.com/#1UQADD#2 press key 'z' to move cube No worries, Just wasn't sure if you knew how to get a blender export in the playground. Glad you're getting it figured out, thats the best feeling. On 9/20/2016 at 9:59 AM, Deltakosh said: @webGLmmk: your doc is COOL. Why not integrating it in our documentation site? https://github.com/BabylonJS/Documentation Will definitely do that. That WAS the plan, I've just been getting distracted. Going to add a bit more about getting CORS free images, with examples, then I'll submit it. Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 22, 2016 Share Posted September 22, 2016 Quote Or did I missed something ? Cris, my greenSphere/meshPlayer starts well above the floor (use control dragging to adjust camera to see things better). A few 'z' keypresses, and my sphere has fallen halfway thru the floor. It should ONLY fall until the bottom of the green sphere is against the floor.... because the green sphere is exactly the same size as meshPlayer.ellipsoid. In other words, green sphere == meshPlayer.ellipsoid. So... hmm. If your project is working correctly, yep... I'm with @webGLmmk in saying "thats the best feeling." But still, I wanted to do some learning, trying a "visual ellipsoid", and doing some more collision testing. *shrug* Goofin' around. That's how I learn things. And yes, continuous collision is definitely not wanted, and I am glad that you discovered that. @RaananW, @Deltakosh, and @Dad72 have all done advanced work with .moveWithCollisions, including discussing "rubbing on the ground/floor"... so there are many forum posts about .moveWithCollisions. Don't quote me, buy I think I once looked at some code... that appeared to "back-out" a collision after it was detected. In other words, I think I saw some code that tries to keep .moveWithCollisions from getting stuck in continuous intersect/collision. But I'm not sure. I think I am using some bad numbers when I create the velocity variable, and that is making my green sphere and meshPlayer... drop into the floor. I might play with it some more... after I grab a few more hours of sleep:) It is a good playground/scene to do collision learning - with. I hope you don't mind me/us extending your thread and doing some tests with your scene. It is good fun! Maybe I should try a "ramp" next? Drive "over" certain sections of wall? That would be a good torture-test for collision ellipsoids and fake gravity, huh? Perhaps we can clone/instance your current maze, and make a second and third floor... with along-the-side ramps connecting them? Cooooool. This COULD get demented. heh. Someone else did something similar, once. Not sure who, or what it's story is. Good steal-able code, though. We once had a "maze contest" here on the BJS forum. I think there were 9 entries, if I remember correctly. *shrug* GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Cris Posted September 23, 2016 Author Share Posted September 23, 2016 Wingnut, I'm very glad that you feel interested in my little game, and you can extending it by yourself. Thanks to your help, I can continually develop this maze game. Now I can move my spider robot with .moveWithCollision function successfully. I will consider add some ramp or step in my scene in the feature. Thank you again for your generous help! @Wingnut Wingnut and GameMonetize 2 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.