Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Whats the simplest phisics library that works good with SFML?  (Read 6793 times)

0 Members and 1 Guest are viewing this topic.

reethok

  • Newbie
  • *
  • Posts: 23
    • View Profile
    • Email
I just need collision detection :)

Greetings.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: Whats the simplest phisics library that works good with SFML?
« Reply #1 on: May 18, 2013, 07:34:29 pm »
I just need collision detection :)
What kind of collision detection? If rectangles or circles are enough, just implement it yourself.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

reethok

  • Newbie
  • *
  • Posts: 23
    • View Profile
    • Email
Re: Whats the simplest phisics library that works good with SFML?
« Reply #2 on: May 18, 2013, 08:18:50 pm »
Different form sprites with transparency. Also, as there will be many of them, i need some efficiency

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: Whats the simplest phisics library that works good with SFML?
« Reply #3 on: May 18, 2013, 08:52:04 pm »
What forms will you have? This determines what collision algorithms to use...

(And how does transparency influence the collision? You probably want to have a separate logical representation of your shapes anyway)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

reethok

  • Newbie
  • *
  • Posts: 23
    • View Profile
    • Email
Re: Whats the simplest phisics library that works good with SFML?
« Reply #4 on: May 18, 2013, 10:23:38 pm »
Something like this:



But will be many different animations (laser and different kind of bullets).

It's for a simple Tower Defense game I want to do. I know how to do everything allready except the collition part.

What i want is t skip the total transparency (it doesnt count of rthe collition), and to set a lvloftransparency that counts. (In that laser sprite, just the brightest will count for the cllition)

Sorry for my crappy english :A

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10801
    • View Profile
    • development blog
    • Email
Re: Whats the simplest phisics library that works good with SFML?
« Reply #5 on: May 20, 2013, 04:11:31 pm »
Pixel perfect collision is an expensive test and in most cases not unnecessary. You might be way better of with a rotated bounding box test, just google a bit for it.

Tower defense is a widely spread topic, maybe you could give some more insight on how exactly it will be.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

kralo9

  • Newbie
  • *
  • Posts: 44
    • View Profile
    • Email
Re: Whats the simplest phisics library that works good with SFML?
« Reply #6 on: May 21, 2013, 04:32:25 pm »
I wouldn't use a real collision detection for tower defense games. Instead, you could let the bullet fly towards the targeted enemy and then just check the distance between enemy and bullet. Then for approving collision, you can say, that every distance lower than 5.f is a hit or at the latest when the distance starts increasing (the bullet passed the enemy).

That would be a really fast "collision" detection (maybe checking distances, circle collision detection, is the fastest)

Give it a try! :D
I'm totally exhausted. I've got 3 children and no money! Why can't I have no children and 3 money? - Homer S.

 

anything