#p5js - Weird collision detection

10 messages · Page 1 of 1 (latest)

dim canopy
tacit geode
#

You need better detection of which site is hit. You can test which corners are the nearest and then decide on this which side it is.

dim canopy
#

Hmm... I see

#

so something like

#
a) find the nearest point
b) Is the x or y closer?
c) x: 
     xSpeed > 0? right
     xSpeed <= 0? left
   same thing for y
dim canopy
#

does that look good @tacit geode?

dim canopy
#

yayy! i implemented the 'algorithm' abouve

#

and now it works

#

but there is some weird things with the angle

tacit geode
#

Nice