Jump to content
  • Advertisement
Sign in to follow this  
ahmetay

How to NOT get INTO the walls - like Counter Strike

This topic is 3799 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!