This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
raycasting_line_intersections [2023/04/17 15:28] max Added section regarding what raycasting is as an intro |
raycasting_line_intersections [2023/04/17 16:13] (current) max update syling on linetesting |
||
---|---|---|---|
Line 13: | Line 13: | ||
Overall, raycasting is a powerful technique for simulating physics in real-time applications and games, and it has a wide range of practical uses. | Overall, raycasting is a powerful technique for simulating physics in real-time applications and games, and it has a wide range of practical uses. | ||
+ | ===== What's the difference between Raycasting and Linetesting? | ||
+ | Raycasting and linetesting are two common techniques, while both techniques are used to determine if a line segment intersects with any objects in a scene, they have distinct differences in their approach. | ||
- | ===== Raycasting:: | + | The main difference between raycasting and linetesting is that raycasting uses a single point to check for intersection, |
+ | |||
+ | |||
+ | ===== Raycasting functions ===== | ||
+ | |||
+ | ==== Spheres ==== | ||
+ | |||
+ | **Raycasting:: | ||
Tests if a ray intersects a sphere. | Tests if a ray intersects a sphere. | ||
Line 27: | Line 36: | ||
- '' | - '' | ||
- | ===== Raycasting:: | + | ==== AABBs ==== |
+ | |||
+ | |||
+ | **Raycasting:: | ||
Tests if a ray intersects an axis-aligned bounding box (AABB). | Tests if a ray intersects an axis-aligned bounding box (AABB). | ||
Line 40: | Line 52: | ||
- '' | - '' | ||
- | ===== Raycasting:: | + | ==== Oriented Boxes ==== |
+ | |||
+ | **Raycasting:: | ||
Tests if a ray intersects an oriented bounding box (OBB). | Tests if a ray intersects an oriented bounding box (OBB). | ||
Line 53: | Line 67: | ||
- '' | - '' | ||
- | ===== Raycasting:: | + | ==== Planes |
+ | |||
+ | |||
+ | **Raycasting:: | ||
Tests if a ray intersects a plane. | Tests if a ray intersects a plane. | ||
Line 66: | Line 83: | ||
- '' | - '' | ||
- | ===== Raycasting:: | + | ==== Triangles |
+ | |||
+ | |||
+ | **Raycasting:: | ||
Tests if a ray intersects a triangle. | Tests if a ray intersects a triangle. | ||
Line 79: | Line 99: | ||
- '' | - '' | ||
- | ===== Raycasting:: | + | ==== Meshes |
+ | |||
+ | |||
+ | **Raycasting:: | ||
Tests if a ray intersects a mesh. | Tests if a ray intersects a mesh. | ||
Line 92: | Line 115: | ||
- '' | - '' | ||
- | ===== Raycasting:: | + | ==== Entities |
+ | |||
+ | **Raycasting:: | ||
Tests if a ray intersects an entity. | Tests if a ray intersects an entity. | ||
Line 105: | Line 130: | ||
- '' | - '' | ||
- | ===== Raycasting:: | + | ===== Line testing ===== |
+ | |||
+ | ==== Spheres ==== | ||
+ | |||
+ | **Raycasting:: | ||
Tests if a line intersects a sphere. | Tests if a line intersects a sphere. | ||
Line 118: | Line 147: | ||
- '' | - '' | ||
- | ===== Raycasting:: | + | ==== AABBs ==== |
+ | |||
+ | |||
+ | **Raycasting:: | ||
Tests if a line intersects an axis-aligned bounding box (AABB). | Tests if a line intersects an axis-aligned bounding box (AABB). | ||
Line 131: | Line 163: | ||
- '' | - '' | ||
- | ===== Raycasting:: | + | ==== Oriented Boxes ==== |
+ | |||
+ | |||
+ | **Raycasting:: | ||
Tests if a line intersects an oriented bounding box (OBB). | Tests if a line intersects an oriented bounding box (OBB). | ||
Line 144: | Line 179: | ||
- '' | - '' | ||
- | ===== Raycasting:: | + | ==== Planes |
+ | |||
+ | |||
+ | **Raycasting:: | ||
Tests if a line intersects a plane. | Tests if a line intersects a plane. | ||
Line 157: | Line 195: | ||
- '' | - '' | ||
- | ===== Raycasting:: | + | ==== Triangles |
+ | |||
+ | |||
+ | **Raycasting:: | ||
Tests if a line intersects a triangle. | Tests if a line intersects a triangle. | ||
Line 170: | Line 211: | ||
- '' | - '' | ||
- | ===== Raycasting:: | + | ==== Meshes |
+ | |||
+ | |||
+ | **Raycasting:: | ||
Tests if a line intersects a mesh. | Tests if a line intersects a mesh. | ||
Line 183: | Line 227: | ||
- '' | - '' | ||
- | ===== Raycasting:: | + | ==== Entities |
+ | |||
+ | |||
+ | **Raycasting:: | ||
Tests if a line intersects an entity. | Tests if a line intersects an entity. | ||
Line 196: | Line 243: | ||
- '' | - '' | ||
- | ---- Support ---- | ||
- | ===== Raycasting:: | + | ===== Support Functions ===== |
+ | |||
+ | |||
+ | **Raycasting:: | ||
Calculates the barycentric coordinates of a point in relation to a triangle. | Calculates the barycentric coordinates of a point in relation to a triangle. |