Problem with Collision Angles

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
FloodWalk
Prole
Posts: 3
Joined: Mon Nov 08, 2010 3:50 pm

Problem with Collision Angles

Post by FloodWalk »

So I'm working on my first love game, a sling-shot kinda game using the love.physics. I've ran into a problem with getting correct collisions results from objects.
Whenever the shot hits a wall the resulting collision angle isn't correct. IE it will hit the wall with in incoming angle of say 10 degrees from the perpendicular of the wall and leave with an angle of 0 degrees, aka perpendicular to the wall, instead of -10 degrees.

I found a few hits about this on the box2d forums but couldn't find any concrete answer. Any help would be appreciated ^^
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Problem with Collision Angles

Post by Robin »

Odd. Could you give us a .love? That usually helps. ;)
Help us help you: attach a .love.
User avatar
FloodWalk
Prole
Posts: 3
Joined: Mon Nov 08, 2010 3:50 pm

Re: Problem with Collision Angles

Post by FloodWalk »

Sure, here's the basic concept.
Attachments
angleSS.love
(1.79 KiB) Downloaded 193 times
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Problem with Collision Angles

Post by Robin »

It doesn't run for me: assertion failed. Not sure why exactly.
Help us help you: attach a .love.
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

Re: Problem with Collision Angles

Post by TechnoCat »

I have a feeling it has to do with restitution.
On second thought, I meant friction.
Or both, I don't know.
User avatar
FloodWalk
Prole
Posts: 3
Joined: Mon Nov 08, 2010 3:50 pm

Re: Problem with Collision Angles

Post by FloodWalk »

...grr. I feel like a moron :roll:
Thanks technocat.
Robin wrote:It doesn't run for me: assertion failed. Not sure why exactly.
Linux? Mac? Windows?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Problem with Collision Angles

Post by Robin »

Linux. But it failed due some Box2D problem, as usually is the case when an assertion fails. Unfortunately, the error messages you get are never very helpful.
Help us help you: attach a .love.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 116 guests