-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skater can bounce back up an incline when originally on a descent. #172
Comments
Thanks for this bug report. I suspect what is happening in the code is that the skater is detaching from the track, then reattaching suddenly. I'll look into it. Reassigned to @samreid. |
It looks like this problem may be caused by the solution to #142 |
It is pretty easy to reproduce this problem based on the instructions above. I think we may need to (a) find out why the skater is detaching from the track when it would just immediately recollide, or (b) add a rule that prevents the skater from reattaching from a time/point close to where it detached (as in #142). |
In the above commit, I added code to make sure the skater won't collide with the track again before allowing the skater to detach, and it appears to have solved this problem. I tested a number of other cases where the skater falls off/jumps off the track and didn't see any errant behavior. However, this should be tested thoroughly since it may introduce other problematic scenarios. |
@samreid I tested the case described above and the issue is no longer present. I will check for other scenarios where this bug may occur. |
@samreid This issue seems to be fixed but there is another issue that is quite similar to this. When creating a loop and disabling stick to track, the skater sometimes will flip onto the other side of the track. |
https://drive.google.com/file/d/0B1dDzrtWHaLbdnV1VXdQakF1c1U/edit?usp=sharing I'm working on a method of reproducing the error, but I came across this testing 1.0.0-rc.14 |
Good bug find. I think the skater is detaching from the track then reattaching immediately. We should solve this by doing 1 and or 2 below:
|
To solve (1) above, perhaps it would be sufficient to check the velocity vector before and after attachment and make sure their dot product is positive. |
I added logic above to invert the parametric velocity if the 2d velocities mismatch before/after attachment. This should be tested vigorously. |
No longer saw this in 1.0.0-dev.55 while testing on Win 8/Chrome 37 and iPad2&3 iOS 7.1/Safari 9537.53 |
Tested on Win7/IE10 and OSX10.9/Chrome36
The skater behaves in a weird way with "stick to track" disabled. The skater can bounce back up an incline when originally on a descent down the track.
To Reproduce:
-Select Playground Screen
-Disable "stick to track"
-Turn off friction (The bug occurs with friction, but behavior is stranger without)
-Build a line track with two pieces
-Curve the most left portion of the track by moving the left node up wards
-Place Skater on track
The skater will move down the slope, then bounce back up the slope.
The text was updated successfully, but these errors were encountered: