You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just watched the React Europe talk. Sounds like a cool component. But I was thinking what you really want to know is will the mouse enter the component not is it close. You could do this by interpolating the mouse trajectory based on mouse position, speed and acceleration.
// each intervalx=mouse.xxspeed=x-prevxxacc=xspeed-prevxspeed//calculate mouse pos 10 frames aheadfor(leti=0;i<10;i++){xspeed=xspeed+xaccx=x+xspeed// if (x, y) in box and (xspeed**2 + yspeed**2) < 10// mouse very likely to rest in box within 10 frames}
I used this logic in a game where you controlled firefly. A fish would jump out of the water only if based on pre calculating both trajectories it would eat you in ten frames (providing you did not take evasive action). The fish seldom missed and always took you by surprise if you flew too close to the water. What felt cool was the firefly's speed made no difference to the fishes accuracy.
the fish is only missing here because he is photoshopped in
10 frames would give you 160ms to preload even if the mouse was moving fast towards the button from a long distance.
The text was updated successfully, but these errors were encountered:
I'd like to support this in a really flexible way. I'm thinking we can add a prop that takes a function that's called with x and y and returns a boolean indicating whether onBreach should be called?
Just watched the React Europe talk. Sounds like a cool component. But I was thinking what you really want to know is will the mouse enter the component not is it close. You could do this by interpolating the mouse trajectory based on mouse position, speed and acceleration.
I used this logic in a game where you controlled firefly. A fish would jump out of the water only if based on pre calculating both trajectories it would eat you in ten frames (providing you did not take evasive action). The fish seldom missed and always took you by surprise if you flew too close to the water. What felt cool was the firefly's speed made no difference to the fishes accuracy.
the fish is only missing here because he is photoshopped in
10 frames would give you 160ms to preload even if the mouse was moving fast towards the button from a long distance.
The text was updated successfully, but these errors were encountered: