Jump to content

Free Camera Collision Problem with Mesh


somnath281
 Share

Recommended Posts

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 .fbx

2. 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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Oh, I see (and answer to myself in http://www.html5gamedevs.com/topic/17708-collision-issue-with-bounce/ :P ), 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 ?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...