Sign in to follow this  

camera collision detection

This topic is 4018 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hello, i have a camera that always looks at the main character from a certain distance and can be freely rotated around the character, but always stays at its distance. now since the character should always be visible i want to check if something is between the character and the camera position and then place the camera at the nearest intersection point of the occluder. for starters my datasturcture is very simple. the terrain is a regular grid and only whole tiles should be checked. does anyone know of a simple algorithm to accomplish this? thanks!

Share this post


Link to post
Share on other sites
Simple sphere collision should be good enough: Check collision from the center of the sphere(where the camera is) to the planes: check the distance from the center of the sphere to the closest point on those planes. If that distance is closer than the radius of the sphere, the plane colliding/intersecting the sphere.

Share this post


Link to post
Share on other sites
extract the triangles from each cells, and do ollision with those. Using raytrace from character's head, or a swept sphere, to find the furthest valid position.

Share this post


Link to post
Share on other sites

This topic is 4018 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this