Results 1 to 2 of 2

Thread: Physics2D - *** am I doing wrong

  1. #1
    Lesser Knight
    Join Date
    Sep 2010
    Location
    Germany
    Posts
    36

    Question Physics2D - *** am I doing wrong

    Hello,

    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.


    Description
    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:
    https://github.com/thecherry94/Cherr...0Moon%20Lander
    (It might be some ugly code because I kinda suck at C++)


    Thanks for your time!

  2. #2
    Lesser Knight
    Join Date
    Sep 2010
    Location
    Germany
    Posts
    36

    Default

    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?
    Last edited by Tuisto; 05-20-2014 at 08:18 AM.

Similar Threads

  1. Something wrong?
    By ryanlcr in forum Bugs & Glitches
    Replies: 19
    Last Post: 11-23-2013, 07:21 PM
  2. Something is wrong
    By Bobotov in forum Bugs & Glitches
    Replies: 1
    Last Post: 04-03-2013, 08:54 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •