Hardon Collider:high velocity colliders going through walls

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
Ethan-Taylor
Prole
Posts: 34
Joined: Mon Nov 24, 2014 9:15 pm

Hardon Collider:high velocity colliders going through walls

Post by Ethan-Taylor »

Hey everyone,
It's me again.

Image

^ this is a photo of the problem.

As you can see, the bullets that are fired from the player are super fast, and sometimes they go through walls because of this. (I think)
I've tried everything.
Killing the velocity, using the seperating vector, and probably alot more tinkering with stuff.
The collision seems to work flawlessly if I degrade the speed of the bullets. But I obviously want them flying at high speeds!

I've attached a .love file, excuse the visual enhancements and not using OOP. btw the light vs shadow engine is supa awesome!

Thanks, Ettthhaaannn!
Attachments
Yeah.love
(467.57 KiB) Downloaded 160 times
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Hardon Collider:high velocity colliders going through wa

Post by Nixola »

I think Hardon Collider has some setting to prevent bullet passing through, but if you can't find anything you could split its update function, simply calling it twice in a row with dt/2 as parameter
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Ethan-Taylor
Prole
Posts: 34
Joined: Mon Nov 24, 2014 9:15 pm

Re: Hardon Collider:high velocity colliders going through wa

Post by Ethan-Taylor »

Nixola wrote:I think Hardon Collider has some setting to prevent bullet passing through, but if you can't find anything you could split its update function, simply calling it twice in a row with dt/2 as parameter
Are you saying to get the update function from the lib, then call it twice?
Ethan-Taylor
Prole
Posts: 34
Joined: Mon Nov 24, 2014 9:15 pm

Re: Hardon Collider:high velocity colliders going through wa

Post by Ethan-Taylor »

Ethan-Taylor wrote: Are you saying to get the update function from the lib, then call it twice?
^ Didn't work if that's what you meant.
It stuffed it up more.
User avatar
ivan
Party member
Posts: 1915
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Hardon Collider:high velocity colliders going through wa

Post by ivan »

To prevent tunneling you can:
1.use a fixed time step with accumulators. the most sensible solution if you know the max velocity of bodies
2.use ray-casting to simulate very fast moving objects
3.use a continuous collision library like box2d
Ethan-Taylor
Prole
Posts: 34
Joined: Mon Nov 24, 2014 9:15 pm

Re: Hardon Collider:high velocity colliders going through wa

Post by Ethan-Taylor »

ivan wrote:To prevent tunneling you can:
1.use a fixed time step with accumulators. the most sensible solution if you know the max velocity of bodies
2.use ray-casting to simulate very fast moving objects
3.use a continuous collision library like box2d
I'm real new to all this stuff, can you please describe how to do the 1st solution?

btw I'm not keen on using box2D XD
Zeliarden
Party member
Posts: 139
Joined: Tue Feb 28, 2012 4:40 pm

Re: Hardon Collider:high velocity colliders going through wa

Post by Zeliarden »

Yo!
Your box is made out of 4 harddon collision rektangels. Increase the width (or hight) of them would fix the problem
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 5 guests