Jump to content
  • Advertisement
Sign in to follow this  
Quat

Volumes

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

I'm wondering how to handle volumes (areas marked where you want something to happen when a player enters/leaves/is in the area). Should I keep a separate volume list and for each volume, and every update check if an object is in it? Or should I let the collision system handle it; for example, when a player intersects the trigger, the collision system could send a message to both the player and the volume object. Each volume could keep a list of game objects in it, so that it can test when a new object enters or an object leaves and react appropriately. Thoughts?

Share this post


Link to post
Share on other sites
Advertisement
It's essentially a collision check that you're doing, so why not use your collision system for it? As long as you keep in mind that you need to check against the volume and not just the hull, you should do fine. Why duplicate code and responsibilities?

As for storing game objects within this trigger (I assume you mean to store references to game objects), that's probably the best way to check when an object leaves the trigger, but you should leave entering the trigger up to moving objects themselves - when they end up within your trigger volume, the collision system will already notify your trigger, so there's no need for the trigger to poll for that.

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!