Jump to content
  • Advertisement
Sign in to follow this  
Elit3d

[SFML] GlobalBounds Height

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

Is it possible to change the height of a global bounds to be smaller to change the collision box? Or would there be a better way of doing this?

Share this post


Link to post
Share on other sites
Advertisement

getGlobalBounds() just returns a rect describing the current state of the sprite in the global space. The function is const and therefore does not alter the state of the object. The rect is only informational.

 

Don't use sprite properties to run your physics/collision. Those systems shouldn't know anything about each other. Your entity objects should have a sprite and a collider of some sort. Move the collider around during your physics and collision pass and then set the sprite position and etc when it's time to draw.

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!