Week 4 - Tracelines and Bounding Boxes
Today we went over the Edgelord code a bit since not a lot of students did it.
We then moved on to a really critical topic, which is the use of rectangles and bounding boxes in games. Rectangles (especially axis-aligned rectangles) are really, really easy to see if a point is within them, and fairly easy (though you have to think back to 7th grade Algebra) to see if a line intersects them. Because it's really easy to see if a line hits a rectangle, you can wrap a complex object in a bounding box to do a quick test to see if the line misses the object entirely, and if it does hit the bounding box, do a more expensive collision test if you like.
Since it can be really expensive to test a line against all the objects in your world, it's important to use a data structure to hold the objects in your world. So we talked BSPs (Binary Space Partitions, with a brief mention of K-d trees), quadtrees, grids, and BVHs. Each has their benefits and tradeoffs, with the ultimate goal of having to only test a handful of collisions in a world with potentially millions of objects in it.
Other Videos By Bill Kerney
2021-02-12 | Week 4 Day 3 - Invalid / Valid / Sound Arguments |
2021-02-12 | Week 5 Day 2 - Dynamic Materials II - Water |
2021-02-11 | Week 5 Day 2 - Syscalls |
2021-02-11 | Week 4 Day 2 - Fallacies Part 1 |
2021-02-10 | Week 5 Day 2 - Linked List II |
2021-02-10 | Week 5 Day 1 - Dynamic Materials and Water |
2021-02-09 | Week 5 Day 1 - GDB and 2D Arrays with ARM32 |
2021-02-08 | Week 4 Day 1 - Scratch Part 2 |
2021-02-08 | Week 5 Day 1 - Linked Lists |
2021-02-06 | Week 3 Day 3 - Scratch |
2021-02-05 | Week 4 - Tracelines and Bounding Boxes |
2021-02-05 | Week 4 Day 3 - TDD and Linked Lists |
2021-02-04 | Week 4 Day 2 - UE4 Materials |
2021-02-04 | Week 4 Day 2 - Embedded ASM and Name Mangling |
2021-02-04 | CSCI 1 Week 3 Day 2 - Moral Frameworks |
2021-02-03 | Week 4 Day 2 - Big O Notation |
2021-02-02 | Week 4 Day 1 - Landscape and Foliage |
2021-02-02 | Week 4 Day 1 - Strings and Memory Access |
2021-02-02 | CSCI 1 Week 3 Day 1 - Conditionals and Lying |
2021-02-01 | Week 4 Day 1 - The Standard Library & Ranges |
2021-01-29 | Week 3 - Edgelord Detection and review of creating Convex Hulls |