Camera Physics. Differnet Approches

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

Recommended Posts

No a days i am playing with physics. Using Ogre for graphics and PhysX for physics. http://www.ogre3d.org/phpBB2/viewtopic.php?t=42869 Also have complete code for 3rd person camera system. http://www.ogre3d.org/phpBB2/viewtopic.php?t=42900 Now i want to integrate physics and camera to collid with physical objects. I make a search on net but found nothing intresting. I want to know different approches to make camera collide with the objects. Thanks. AbsoluteCPP.

Share on other sites
usually, a ray-cast from the anchor point to where the camera would be ideally. Or a swept volume check (put a sphere around the camera). You stop the camera at the nearest collision (with other object, or a wal, ect).

Share on other sites
Quote:
 Original post by oliiiusually, a ray-cast from the anchor point to where the camera would be ideally. Or a swept volume check (put a sphere around the camera). You stop the camera at the nearest collision (with other object, or a wal, ect).

Can u explain in more detail,
Plz provide link regarding this technique if u have..

Thanks.

Share on other sites
There is nothing to it really.

Usually, your camera focuses on point near the player (above the head, shoulder cam, ...), along a direction. You trace backward from that point, up to a maximum distance (say, 3 meters), and query the collision system for the first collision. Then you place the camera at that collision if there is one, else at the max distance.

I dont know physx, so I wouldn't know what calls you have to make, but it should be pretty straight forward.

Oh yeah, you probably need to use a collision callback to filter out objects that are not suppose to obstruct your camera (i.e. the player himself, the car he is driving, ect...).

1. 1
2. 2
3. 3
Rutin
14
4. 4
frob
12
5. 5

• 9
• 9
• 11
• 11
• 23
• Forum Statistics

• Total Topics
633670
• Total Posts
3013262
×