jerome Posted February 1, 2017 Share Posted February 1, 2017 Skulls, facetData, no physics engine and not that accurate collisions, but collisions anyway http://www.babylonjs-playground.com/#2HMTYB Wait until the skull object is downloaded. 50 instances and 60 fps in chrome here. NasimiAsl and joshcamas 2 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted February 1, 2017 Share Posted February 1, 2017 i see 60 fps in first but that 4 fps after 30 sec great work Quote Link to comment Share on other sites More sharing options...
joshcamas Posted February 1, 2017 Author Share Posted February 1, 2017 4 minutes ago, jerome said: 50 instances and 60 fps in chrome here. Dude I love it! What is facet data? I'm getting a solid 60 fps as well EDIT: Clearly you're the master of this, do you know why my code is glitching?http://www.babylonjs-playground.com/#1BVXYE#18 Quote Link to comment Share on other sites More sharing options...
jerome Posted February 1, 2017 Share Posted February 1, 2017 The glitch is probably due to a wrong position setting. Example : on collision, you may position the ball somewhere, but this location also triggers the collision call... so it's positioned again and again somewhere where the collision process is re-run. Just position it a bit farther, it should work. [EDIT] facetData doc : http://doc.babylonjs.com/tutorials/how_to_use_facetdata Quote Link to comment Share on other sites More sharing options...
joshcamas Posted February 1, 2017 Author Share Posted February 1, 2017 12 hours ago, jerome said: The glitch is probably due to a wrong position setting. Example : on collision, you may position the ball somewhere, but this location also triggers the collision call... so it's positioned again and again somewhere where the collision process is re-run. Just position it a bit farther, it should work. That's what I'm thinking! But it *shouldn't* do this, because it moves it by the distance... (delta). But I'll check it out, thanks! Quote Link to comment Share on other sites More sharing options...
joshcamas Posted May 8, 2017 Author Share Posted May 8, 2017 Alright, we're getting there! Simple collision works!! http://www.babylonjs-playground.com/#1BVXYE#25 How it works: The collision system is currently static vs dynamic, aka a character vs a wall. This is done by enabling static collision and dynamic collision by collision group. This allows different objects to collide to different objects. staticMesh.enableStaticCollision("world",scene); dynamicMesh.enableDynamicCollision("world",scene) Adds both a static and dynamic mesh to the collision group "world". And now to update the collision system, simply run: scene.updateCollision() In your update loop. The next step is a dynamic+dynamic collision, although I'm not quite sure how I'll design that. Also, maybe different shapes, as well as custom bounding boxes. (instead of using the bounds built into the mesh. It'd also be interesting to implement bouncing and other simple physics stuff I'm also considering adding a simple bounding box visual system, and *maybe* add higher end collision (rotation affects collision) 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.