Simple, lightweight, general purpose collision detection

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

Re: Simple, lightweight, general purpose collision detection

Post by TechnoCat »

vrld wrote:There will be a tutorial featuring how to write a simple game using HardonCollider soon.
Please involve rolling circles!
User avatar
vrld
Party member
Posts: 917
Joined: Sun Apr 04, 2010 9:14 pm
Location: Germany
Contact:

Re: Simple, lightweight, general purpose collision detection

Post by vrld »

Changes!
  • I finished writing up Part 0 and Part 1 of the tutorial. It involves no rolling circles though.
  • There are now point-in-shape and ray-intersection tests.
  • Tweaks for huge (or mediocre) performance gains
The future:
  • Point Shapes
  • Part 2 of the tutorial
  • Part 3 of the tutorial
  • Something else? (Any feature you wish for?)
I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum.

hump | HC | SUIT | moonshine
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

Re: Simple, lightweight, general purpose collision detection

Post by TechnoCat »

vrld wrote:
  • Something else? (Any feature you wish for?)
Rolling circles! :crazy:
User avatar
miko
Party member
Posts: 410
Joined: Fri Nov 26, 2010 2:25 pm
Location: PL

Re: Simple, lightweight, general purpose collision detection

Post by miko »

Robin wrote:
kikito wrote:Maybe it's a little early to ask this, but - will it be Lua & C++, or Lua-only?
It would probably make the most sense to make it Lua-only, because more lovers are familiar with Lua than with C++ and more importantly, if we do use C++ and want to gain any traction, it would have to be included in the LÖVE core, and I don't know how the devs feel about that. If they do want to include it, the heavy stuff and inner loops could probably be done in C++.
Note: for love compiled with luajit2, the pure lua implementation actually will be faster than using C++ because it is expensive to cross lua/C++ boundary.
My lovely code lives at GitHub: http://github.com/miko/Love2d-samples
User avatar
vrld
Party member
Posts: 917
Joined: Sun Apr 04, 2010 9:14 pm
Location: Germany
Contact:

Re: Simple, lightweight, general purpose collision detection

Post by vrld »

Welcome to the future:
HardonCollider now has point shapes (useful for (slow) bullets and stuff)
I've also fixed this bug and another bug with collisions between circles.
TechnoCat wrote:Rolling circles! :crazy:
I can offer you one rolling (and bouncing) circle:
Attachments
rollingballdemo.love
(16.32 KiB) Downloaded 248 times
I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum.

hump | HC | SUIT | moonshine
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Simple, lightweight, general purpose collision detection

Post by Robin »

vrld wrote:I can offer you one rolling (and bouncing) circle:
That *is* crazy! (Everyone who doesn't know what I'm talking about: let the ball roll down and wait. Perpetual motion FTW!)
Help us help you: attach a .love.
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

Re: Simple, lightweight, general purpose collision detection

Post by TechnoCat »

vrld wrote:
TechnoCat wrote:Rolling circles! :crazy:
I can offer you one rolling (and bouncing) circle:
My dreams, they come true!
chris
Prole
Posts: 17
Joined: Sat Sep 20, 2008 5:48 am

Re: Simple, lightweight, general purpose collision detection

Post by chris »

I humbly want to request a feature for Hardon Collider.

There is a shape:move() and a shape:moveTo() function. The moveTo sets the position.
There is also a shape:rotate() function. But not a rotate function that sets the rotation. I would really like that.
User avatar
vrld
Party member
Posts: 917
Joined: Sun Apr 04, 2010 9:14 pm
Location: Germany
Contact:

Re: Simple, lightweight, general purpose collision detection

Post by vrld »

chris wrote:I humbly want to request a feature for Hardon Collider.
Done. you can set the rotation with shape:setRotation(). As a by-product, you can get the shape's rotation with shape:rotation().
I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum.

hump | HC | SUIT | moonshine
chris
Prole
Posts: 17
Joined: Sat Sep 20, 2008 5:48 am

Re: Simple, lightweight, general purpose collision detection

Post by chris »

Nice :) Another question:

Why is it that if I make a rectangle:
box.x = 5
box.y = 6
box.box = HC.addRectangle(box.x,box.y,50,50)

And I want to move it 3 pixels to the right, I have to write this:
box.box:moveTo(box.x+25+3,box.y+25)
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 6 guests