Sign in to follow this  

ClanLib Collision Detection

This topic is 2830 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 have been playing with ClanLib-2.1 for about a week now. Drawing sprites, using resources, etc is all fairly intuitive. The part that is not intuitive is collision detection. Here is what I am trying to do. All I would like to do is make a sprite bounce off of the four edges of a window. This is easy when I compare the x and y coordinate of the sprite against 0 and width / height of the screen. Everything works perfectly in this case. The case that does not seem to work is when I attempt to use the CL_CollisionOutline class. I have two png files that I use for the "walls" of the screen. One png is a horizontal bar, the other is a vertical bar (pretty simple). Iterating through the CL_Contour and CL_Pointf vectors seems to have the correct collision points, but calls to CL_CollisionOutline.collides() just never seems to work. Note that drawing the outline of the CL_CollisionOutline vs the png image on the screen produces what I would think is correct for the collision point sampling. The code at this point is fairly large, as ClanLib requires quite a bit of glue code to get something running. But, if needed, I could make my example available for download, if that would help someone help me. I've been using the SpritesRTS example that comes with the ClanLib-2.1 install as a tutorial for collision detection. Can anyone offer some insight into ClanLib's collision detection, or at least point me to some docs or tutorials that might help? Thanks! mw

Share this post


Link to post
Share on other sites
There is maybe a better chance to get a response if you post this on the official ClanLib forums?

http://www.rtsoft.com/forums/forumdisplay.php?f=13/clanlib

Share this post


Link to post
Share on other sites

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