Camera Collisions

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
ggblake
Posts: 7
Joined: Thu Sep 17, 2009 4:19 pm

Camera Collisions

Post by ggblake »

what is the simplest way to keep a camera from passing through entities
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Camera Collisions

Post by Norbo »

You could create a dynamic entity that represents the 'body' of the camera. User input would be used to change the velocity of the entity, and the camera's view matrix would be updated based on the entity's position each frame.

You may end up wanting to make the entity unaffected by gravity, using the entity.isAffectedByGravity = false flag. Additionally, if you don't want the camera entity to rotate, you can set its localSpaceInertiaTensorInverse to the zero matrix.
Post Reply