Jump to content

Camera follows a character ever cut by a wall?


Dad72
 Share

Recommended Posts

Hi,
 
I change the stage Raanan by adding models to instead. and as you can see there is a worry, the camera does not pass in front of the camera models and also flashes.
 
He defrauded that it takes into account the size of each object, I guess.
 
I have no idea how to solve this. Thank you for your help Raanan.

 

http://www.babylonjs-playground.com/#12D0ST

Link to comment
Share on other sites

Hi dad72,

 

http://www.babylonjs-playground.com/#12D0ST#1

 

A short explanation -

First - I made a small mistake. The radiusReset variable should only set to true if the radius was actually changed. That was the reason to some of the flickering.

The other reason was fastCheck in the pick function. The problem was that the outer wall of the skull was detected and returned a hit. Setting the camera inside the skull actually made sense - you can see the object through the eye/nose etc', but it is not the desired functionality.

Changing fast check to false inspects all of the parts of the mesh and returns the smallest distance. but (as the name suggests) it is slower. So maybe with walls, fastCheck set to true is correct, but with complex meshes, false is the right choice. Two arrays with "simple meshes" and "complex meshes" might come in handy :-)

Link to comment
Share on other sites

Thank you Raanan for your help. it seems perfect. This would be useful I think that such functionality is integrated directly into the engine.

 

[edite] arf, It depends on the models, with some models, I have a flash of the camera.

Link to comment
Share on other sites

I think I understood why. I use moveWithCollisions () on my scene and that create a kind of confusion I think here: pickInfo.hit. should integrate this functionality directly into the engine I think, with moveWithCollisions ()

and it does not work if I tie with the parent item to character

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