mwissink 6 Report post Posted January 13, 2017 I have recently started on a Babylon project, and I have been wanting to create a capsule physics impostor for my game. I found a test demo for Oimo.js that basically achieves what I want: compound test (capsule). There are two problems: 1. due to some shortcomings in Oimo, I have had to switch to Cannon.js. 2. the demo uses Three.js and I'm sure how to exactly translate that into Babylon. I basically want to be able to combine two sphere impostors with a cylinder impostor. I'm not sure what is the best method for this, there are only a few examples that I have found, and I haven't found anything in the docs. So I created an example to show what I am talking about: capsule sandbox. I have created the capsule mesh, but I just need to figure out how to add a capsule impostor. Thanks. Share this post Link to post Share on other sites
Deltakosh 4,306 Report post Posted January 13, 2017 Ping @RaananW Share this post Link to post Share on other sites
Wingnut 2,300 Report post Posted January 16, 2017 http://www.babylonjs-playground.com/#1TZH4F#22 Fun! This one uses box impostors... but... I think it acts pretty well. I think compoundImposters are now deprecated in the newest physics plugins, but it's still worth a playground search. Other than that, I got no help. I don't think cylinderImpostors exist. But a sphereImpostor COULD be tightly "jointed" (physics linked) to each end of a boxImpostor... creating a capsule-like shape. *shrug* Not sure. hopefully, more comments from others, soon. Share this post Link to post Share on other sites
dbawel 466 Report post Posted January 16, 2017 Out of the box, OIMO will do what you want, as long as you declare WORLD_SCALE parameters. Otherwise, Cannon is also a good physics engine, but requires working with parameters which require a bit more tweaking. Create a PG scene, and you'll get the reponses which will solve you're issues. DB Share this post Link to post Share on other sites
dbawel 466 Report post Posted January 16, 2017 Look at this PG: http://www.babylonjs-playground.com/#1MJ09V#9 DB Share this post Link to post Share on other sites
dbawel 466 Report post Posted January 16, 2017 OIMO.WORLD_SCALE = 1; OIMO.INV_SCALE = 1; Share this post Link to post Share on other sites
mwissink 6 Report post Posted January 16, 2017 Thanks for the responses, I will probably just continue to use the box impostor as Wingnut suggested. Share this post Link to post Share on other sites
adam 754 Report post Posted January 16, 2017 12 hours ago, dbawel said: OIMO.WORLD_SCALE = 1; OIMO.INV_SCALE = 1; In BJS >= 2.5 the default world scale for Oimo is 1. 1 RaananW reacted to this Share this post Link to post Share on other sites
RaananW 982 Report post Posted January 24, 2017 COmpound impostors are your friend! Create a box, with two spheres as children, and set their impostors. this will create a single compound that will be computed as a capsule. You can also do that with point-to-point joints, which are practically the same. If I find the time later today I will prepare a quick playground. Share this post Link to post Share on other sites
RaananW 982 Report post Posted January 24, 2017 Well, a silly demo, but - http://www.babylonjs-playground.com/#3PCLR 3 Deltakosh, kpgbrink and mwissink reacted to this Share this post Link to post Share on other sites
mwissink 6 Report post Posted February 6, 2017 Thanks @RaananW, this is basically what I ended up doing! 1 RaananW reacted to this Share this post Link to post Share on other sites