cmm-21 / a5

0 stars 0 forks source link

Task 4 : How close should we be to the demo? #19

Closed lthiet closed 3 years ago

lthiet commented 3 years ago

hi,

i have a few questions regarding task 4 and how similar we should be to the demo.

in the source code comment, it is said that we assume that the ball collides with the ground if the y component of the bottom point of the ball is inferior to 0, yet it seems that in the demo the collisions seems to trigger when the y component of the center of the ball is inferior to 0 for epsilon = 0 and 1. however it seems that for epsilon = 0.5 the collision seems to happen when the bottom point of the ball touches the ground instead of its center. could you say something about this? am i interpreting the demo correctly or am i wrong somewhere?

also, for epsilon 0, in my implementation the ball has a weird slow down movement when it collides with the ground. here's a video. is that normal/expected?

many thanks

lthiet commented 3 years ago

nevermind. i fixed this specific step in my implementation

// 1. update linear and angular velocity (not pose yet!!) of the
// rigidbody by external force and torque before this if statement
// block

i am not quite sure why, but you get what i had (slow down before colliding) if you update the pose whether there is a collision or not then reset it back to its previous value if there is a collision. it is better (same behavior as demo) to check for collision before updating the pose, then update it accordingly only when the conditions are met