Sign in to follow this  

How to NOT get INTO the walls - like Counter Strike

This topic is 3459 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

Hi friends, I modelled a house using quads (C++). When I walk in the house, I can get into the walls(quads,rectangles). But I don't want this. I don't want to get into the walls. How can I do this? For example, in the game Counter Strike, when you are alive you can not get into the walls BUT when you are dead, you CAN get into the walls. If any code needed I used, I can post them here. thanks a lot.

Share this post


Link to post
Share on other sites
Yes you are right.

But in my program, there are static objects. They do not move.

I just use a virtual camera and I have static objects like house, car, garden etc.

I examined these atricles BUT they assume there are moving objects thay may collide.

As I said before, I just have a virtual camera and static objects. The only thing that moves is my virtual camera.

How can this be accomplished?

Share this post


Link to post
Share on other sites
It's still collision detection - it doesn't matter if it's between a static and dynamic object, or if it's between two dynamic objects.

In the simplest way, you could form planes around the objects, and then detect if the camera tries to travel through a plane, and reject the movement (or clip it) if it does.

Collision detection is a pretty complex subject though, there's thousands if not millions of links on Google.

Share this post


Link to post
Share on other sites

This topic is 3459 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