Pryme8 Posted August 14, 2016 Share Posted August 14, 2016 Ok, Im kinda stumped... I have never had a problem getting a physics imposter to work... Cannon is implemented and included, here is the section of the script causing and error: var gravity = new BABYLON.Vector3(0, -9.6, 0); scene.enablePhysics(gravity, new BABYLON.CannonJSPlugin()); scene.collisionsEnabled = true; scene.workerCollisions = true; var player_box = BABYLON.MeshBuilder.CreateTube("p-box", {path: [v3(0.0,0.0,0.0), v3(0.0,2.0,0.0)], radius:0.5, tessellation:8}, scene); player_box.position.y = 4.0; ground.physicsImpostor = new BABYLON.PhysicsImpostor(ground, BABYLON.PhysicsImpostor.BoxImpostor, { mass: 0, restitution: 0.9 }, scene); did something change? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted August 14, 2016 Author Share Posted August 14, 2016 ground.body = ground.setPhysicsState(BABYLON.PhysicsEngine.MeshImpostor, { mass: 0, friction: 0.5, restitution: 0.2 }); ^^ Why does this work? Quote Link to comment Share on other sites More sharing options...
Nabroski Posted August 14, 2016 Share Posted August 14, 2016 .refreshBoundingInfo(); or recalculate the hole BoundingBox thing, for debuging Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted August 14, 2016 Author Share Posted August 14, 2016 Its saying that The physics imposter does not exist, which is crazy... I got it working, but im kinda stumped why the one construction method does not work. Quote Link to comment Share on other sites More sharing options...
Nabroski Posted August 14, 2016 Share Posted August 14, 2016 typecasting ? Tube+get me some pysicx https://doc.babylonjs.com/overviews/Using_The_Physics_Engine Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 15, 2016 Share Posted August 15, 2016 What is ground? a simple ground or a heightmap? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted August 15, 2016 Author Share Posted August 15, 2016 simple Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 15, 2016 Share Posted August 15, 2016 huh....can you repro on the PG? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted August 15, 2016 Author Share Posted August 15, 2016 maybe, I think I scraped that part of the script... let me see if I have a version archived somewhere. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted August 15, 2016 Author Share Posted August 15, 2016 http://www.babylonjs-playground.com/#1CHL69#0 Ok I am searching my computer and deleting all instances of BJS, and just using the CDN from now on. Im thinking this is all because somehow a old version found its way into my files. Sorry to waist time. 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.