ScratchData LogoScratchData
Back to Code_of_Nature's profile

#30 SAT Collision Detection

COCode_of_Nature•Created May 3, 2024
#30 SAT Collision Detection
7
5
81 views
View on Scratch

Description

[R] to reset tutorial: https://code.tutsplus.com/collision-detection-using-the-separating-axis-theorem--gamedev-169t The Separating Axis Theorem (SAT) is a commonly used technique in computational geometry and collision detection. It is primarily used to determine whether two convex polygons intersect or if they collide. The core concept of this theorem is: if a line (called a separating axis) can be found that separates the two polygons, then these polygons do not intersect. The applications of the Separating Axis Theorem are widespread, including 2D and 3D collision detection, physics engines, game development, and more. It is efficient and easy to implement, making it widely adopted. The general steps for implementing the Separating Axis Theorem are as follows: Construct all possible separating axes: For each polygon, find all possible normals (typically the normals of the polygon's edges). Projection: Project the vertices of the two polygons onto these separating axes to obtain intervals of projection. Check for overlap in projections: Examine whether the projections of the two polygons on each separating axis overlap. If any pair of projections does not overlap, the polygons do not intersect; otherwise, they intersect. The advantages of this method are its simplicity, efficiency, and applicability to convex polygons of any shape. However, for non-convex polygons, it requires more complex handling and may need to be combined with other techniques to solve collision detection problems.

Project Details

Project ID1012906821
CreatedMay 3, 2024
Last ModifiedMay 4, 2024
SharedMay 3, 2024
Visibilityvisible
CommentsAllowed