somnath281 Posted October 7, 2015 Share Posted October 7, 2015 Hello,I am getting a problem while my free camera collides with mesh.Steps Done:1. Created meshes in Maya (bed, floor, wall) and export these as .fbx2. Import these .fbx files into blender (turn on check collisions, use flat shading)3. In blender added light and camera (turn on check collisions, apply gravity for camera).4. Export as .babylon files.5. In babylon engine loaded bed using BABYLON.SceneLoader.Load()6. floor and wall using BABYLON.SceneLoader.ImportMesh(). while I am walking on ground and colliding with bed it pushing the camera back. Any solution? Quote Link to comment Share on other sites More sharing options...
RaananW Posted October 7, 2015 Share Posted October 7, 2015 What version of BJS are you using? can you publish a simple demo for us to see the problem? Quote Link to comment Share on other sites More sharing options...
somnath281 Posted October 8, 2015 Author Share Posted October 8, 2015 Please click on this link.https://drive.google.com/file/d/0B-cQHtrVjRzwckltMGVYRUhmbkE/view?usp=sharing I am using latest version of BJS. I tried with older version also (babylon.2.1.debug.js) but getting same result. Quote Link to comment Share on other sites More sharing options...
RaananW Posted October 8, 2015 Share Posted October 8, 2015 This seems to be the same problem as here - http://www.html5gamedevs.com/topic/17708-collision-issue-with-bounce/ Deltakosh's solution:scene.gravity.y /= 100;works here as well. @DK - maybe the default gravity should not be so high? (0,-9.8, 0) is actually not so important for the internal collision detection. the -9.81 is important for the physics engine, but it is being set there anyhow again. Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted October 8, 2015 Share Posted October 8, 2015 Oh, I see (and answer to myself in http://www.html5gamedevs.com/topic/17708-collision-issue-with-bounce/ ), the internal collision system is not based on the same "scale" as the physics engine ? But I then have an new question coming: now when camera collides with a mesh, it bounces back automatically ? Wounld't just be better and more generic to stop the camera movement without bouncing back ? Is that a relatively new feature ? When I implemented my cameras some month ago, I had to do myself the bouncings or slidings or whatever else in the onCollide method, is that not required anymore ? Quote Link to comment Share on other sites More sharing options...
RaananW Posted October 8, 2015 Share Posted October 8, 2015 For your first question - not, they are not connected. The scene's gravity is simply a vector that is added to your movement vector (you are technically always walking "down") so as long as it is smaller than the camera's speed (in case you look up and go "forward"), you will stay on the ground. I have always used -9.8 on the y and never had problems... I haven't seen this kind of behavior yet, but I also checked with 2.1, and it is the same. for 2.1 I have simplified the gravity inspection (before there were two inspections - one for the movement forward and one for the gravity vector), maybe that caused this somehow (but it was important for the web-workers integration). It usually doesn'T bounce. It usually stops. I think this has something to do with stairs / objects that you can climb on. You don't bounce back from walls. Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted October 8, 2015 Share Posted October 8, 2015 Ok, thanks for the piece of info. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 8, 2015 Share Posted October 8, 2015 Yep my fix was the wrong one. Raanan found the issue we introduced with 2.1 It is now fixed 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.