Results 1 to 7 of 7

Thread: Collision problem

  1. #1

    Default Collision problem

    I'm trying to learn about ClanLib, but is a little tricky because the documentation is very short and does not have many examples.

    Anyway, I'm testing the collision system, however, I found an inconsistency that I don't know if it's my fault or a mistake in ClanLib.

    Therefore, I am attaching two attachments, the compiled binary to demonstrate the problem and the other source code.

    The problem itself is the area of collision, when I use the accuracy_medium the blue circle is too small, causing a part of the picture is not detected in collisions.
    When I change to accuracy_high, it works, but I think that should work even in accuracy_medium.

    I'm trying to detect in which position the collision occurred, because I have a ball that should be hitting the screen to bounce it.
    I need to know which side the ball was hit, any idea?

    If anyone can take a look and tell me what's wrong I appreciate it.

    PS: .7z files are not allowed?

    CollisionTest.zip (VS 2010 SP1 - ClanLib 2.2.8)
    bin.zip

  2. #2
    Lesser Knight
    Join Date
    Mar 2009
    Posts
    54

    Default

    The zip files you've uploaded are broken.

  3. #3

    Default

    Quote Originally Posted by huntercool View Post
    The zip files are you've uploaded are broken.
    Broken how? I just download and are not corrupt.

  4. #4
    Lesser Knight
    Join Date
    Mar 2009
    Posts
    54

    Default

    You're right, they are not corrupt.

    It just that the compression method used in your zip file seems to be unsupported by Winrar as suggested by the output: "Unknown method in Collision Test\..." for every file in the archive.

    Also unzip.exe failed as well.

  5. #5

    Default

    Quote Originally Posted by huntercool View Post
    You're right, they are not corrupt.

    It just that the compression method used in your zip file seems to be unsupported by Winrar as suggested by the output: "Unknown method in Collision Test\..." for every file in the archive.

    Also unzip.exe failed as well.
    Well, I don't know about that, i am using 7 zip.

    Anyway, I have made the zips with the Windows now (zip folder).

    Try now, thanks.

    CollisionTest2.zip
    bin2.zip

  6. #6
    Lesser Knight
    Join Date
    Mar 2009
    Posts
    54

    Default

    Indeed, the example shows theres something wrong with accuracy_medium.

    There are two possible reasons that I could think of:
    1. The algorithm that generates the outline is not suitable for an image with many rectangles
    2. A bug in the algorithm

    Perhaps someone with more experience than me could comment on this.

    As for your second problem you could use a combination of normal and point info to calculate the rebound angle of the ball. The penetration_normal should give you a vector showing which side of the wall it hit.

  7. #7

    Default

    Quote Originally Posted by huntercool View Post
    Indeed, the example shows theres something wrong with accuracy_medium.

    There are two possible reasons that I could think of:
    1. The algorithm that generates the outline is not suitable for an image with many rectangles
    2. A bug in the algorithm

    Perhaps someone with more experience than me could comment on this.

    As for your second problem you could use a combination of normal and point info to calculate the rebound angle of the ball. The penetration_normal should give you a vector showing which side of the wall it hit.
    Thanks for the reply.

    I "solved" my problem erasing the first pixel (0,0) of that image, now they calculate the outline correctly.

    I will try the penetration_normal, thanks for the tip!

    []'s

Similar Threads

  1. 2D Collision System
    By Lars in forum Official ClanLib SDK Forums
    Replies: 2
    Last Post: 05-03-2011, 06:31 AM
  2. Collision, where you went???
    By speeder in forum Novashell Game Creation System
    Replies: 1
    Last Post: 05-10-2010, 10:23 PM
  3. collision points strange problem
    By tet2brick in forum Official ClanLib SDK Forums
    Replies: 4
    Last Post: 01-21-2010, 10:58 AM
  4. Collision...
    By catch22 in forum Official ClanLib SDK Forums
    Replies: 3
    Last Post: 07-17-2009, 04:07 PM
  5. Collision thingy
    By attle in forum Novashell Game Creation System
    Replies: 2
    Last Post: 04-29-2009, 11:25 PM

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
  •