TAILIEUCHUNG - C++ Programming for Games Module II phần 10

Tham khảo tài liệu 'c++ programming for games module ii phần 10', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Puck Paddle Collision When a paddle be it blue or red hits the puck a physically realistic response should follow. Thus we must be able to determine how two circular masses paddle and puck physically respond when they collide. The physics of this collision requires a lengthy discussion so we have given it its own separate section in Section . What follows now is an informal conceptual explanation. A more rigorous explanation is given in Section . Before we can even discuss anything about collisions we need some criterion to determine if the paddle and puck collided at all. From Figure it follows that if the length from C1 to C2 is less than or equal to the sum of the radii then the circles must intersect or touch which implies a collision. This will be our criterion for testing whether a collision took place. In pseudocode that is Collision Test if Ik - M s R R2 Intersect true Else Intersect false Figure a The circles are not touching or interpenetrating. b The circles are tangents . touching . c The circles are interpenetrating. Consider Figure where two circular masses m1 and m2 collide. Intuitively each object ought to feel an equal and opposite impulse in the direction n which is perpendicular to the collision point. 267 This vector n is called the collision normal. Incidentally n can be computed by normalizing the vector that goes from C1 to C2 that is c c c c2 C1 n T ---- T c cll Figure A collision. The impulse vectors lie on the line of the collision normal. Here we use the word impulse very loosely. We give its formal physical definition in Section . For now think of impulse as a vector quantity that changes the velocity direction or magnitude or both of an object in the direction of the impulse. In addition to velocities the mass of the objects plays a role in the response. For example if m2 is more massive than m1 we would expect the impulse of the collision to not effect m2 as drastically as m1. To compensate .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.