View Full Version : Physics2D - *** am I doing wrong

05-19-2014, 08:26 AM

Introduction to my Problem
I have been attempting to use ClanLib again after a 2 or 3 months long break and am already failing.
I have two physic bodies that use the collision outline of a .png as shape.
One is the level and the other one the player.

I already got this to work in another project months ago but lost all the code and can't use it as example anymore.

I looked at the Physics2D collision example thoroughly and searched for my mistake but couldn't find any hint.

It's mainly 2 classes that contain the problem: Level and Player.
The Level holds the PhysicsWorld and creates the Player and the Player then gets the PhysicsWorld instance from the Level instance.

The Problem
The player body just falls through the body of the level and doesn't collide.

Here is the github link for ease of viewing:
(It might be some ugly code because I kinda suck at C++)

Thanks for your time!

05-19-2014, 08:36 PM
Ok, I changed the player shape from a ChainShape to a PolygonShape and it is just a box now.

That made it work. I guess the CollisionOutline generated from the image was too small and packed for a ChainShape maybe?