spoderman Posted March 25, 2016 Share Posted March 25, 2016 Hey Guys, i couldnt get collision or gravity working. did i missed something? edit: http://www.babylonjs-playground.com/#M3AQS%230 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 25, 2016 Share Posted March 25, 2016 hello! do you mind creating a little playground to help yu helping you? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 25, 2016 Share Posted March 25, 2016 Oh and btw: you have to move your object with mesh.moveWithCollisions function: http://doc.babylonjs.com/tutorials/Cameras,_Mesh_Collisions_and_Gravity Quote Link to comment Share on other sites More sharing options...
spoderman Posted March 25, 2016 Author Share Posted March 25, 2016 here's the Playground. Verry good idea http://www.babylonjs-playground.com/#M3AQS#0 GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
spoderman Posted March 26, 2016 Author Share Posted March 26, 2016 Is there any way to move in local direction with moveWithCollisions() ? Why is the gravity not working? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 27, 2016 Share Posted March 27, 2016 You can convert world translation into local translation using inverse of mesh.worldMatrix Gravity needs to be applied manulay (calling moveWithCollisions using gravity vector from scene) spoderman 1 Quote Link to comment Share on other sites More sharing options...
spoderman Posted March 28, 2016 Author Share Posted March 28, 2016 Ah, ok. thank you Quote Link to comment Share on other sites More sharing options...
spoderman Posted March 30, 2016 Author Share Posted March 30, 2016 Hey Deltakosh, can you please explain to me how moveWithCollisions() works with mehs.worldMatrix? I am sorry, i'am just a stupid 3D Artist Wha do you mean with applying the gravity manualy? should i move a mesh via code downwards? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted March 30, 2016 Share Posted March 30, 2016 So applying gravity manually: mesh.moveWithCollisions(gravityVector). Usually gravityVector = scene.gravity if you want to move a mesh along a localDirection just do mesh.moveWithCollisions(BABYLON.Vector3.transformCoordinates(direction, mesh.getWorldMatrix()) spoderman 1 Quote Link to comment Share on other sites More sharing options...
spoderman Posted April 2, 2016 Author Share Posted April 2, 2016 i tried this: http://www.babylonjs-playground.com/#2HZMUG#4 but the sphere only moves up verry fast... no mater what i do Quote Link to comment Share on other sites More sharing options...
spoderman Posted April 4, 2016 Author Share Posted April 4, 2016 nobody? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 4, 2016 Share Posted April 4, 2016 Hello! It was my mistake. The direction has to be transformed with TransformNormal: http://www.babylonjs-playground.com/#2HZMUG#5 Sorry about that Quote Link to comment Share on other sites More sharing options...
spoderman Posted April 4, 2016 Author Share Posted April 4, 2016 no problem, thanks a lot, man just for my better understanding. is this a probber way, for example, moving a player and NPC's arround in a level? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 4, 2016 Share Posted April 4, 2016 You can use exactly the code you have spoderman 1 Quote Link to comment Share on other sites More sharing options...
spoderman Posted April 6, 2016 Author Share Posted April 6, 2016 ok, one last question i'am not if i get the gravity thing correct. from other engine(s) i usualy know a process like thie: aktivate gravity, adding gravity to an object and it will keep falling down as long as the scene is running. if i add a collider it will fall until it hits another collider. why i have to move a object, in babylon, manualy down? isn't this making the gravity property a little useless or just i didnt get it right? if i'am thinking a little further and i would like to make a player 'jumping' ... would this be a point where i have to use a real physicengine? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 6, 2016 Share Posted April 6, 2016 Beware here: this will work if you enable the physics engine (plenty of great articles about it in our documentation) The collision system is a lightweight system that you have to use manually. It is faster than the physics engine but less flexible and precise. It's basically the system used by the FreeCamera to simulate collisions with environment spoderman 1 Quote Link to comment Share on other sites More sharing options...
spoderman Posted April 7, 2016 Author Share Posted April 7, 2016 Ok, thank you delta! 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.