Sean
banner
cowtrix.bsky.social
Sean
@cowtrix.bsky.social
makin games @ Callistemon Games, Melbourne
https://cowtrix.github.io/
Checkout some code here: github.com/cowtrix/Unit...
github.com
March 8, 2025 at 11:53 PM
We can then flatten these triangles against a 2D axis by swizzling their coordinates, do the much simpler test of if a triangle is intersecting an axis aligned rectangle, for each triangle. If any of the triangles succeed, the whole axis succeeds. If all axis succeed, the test is a success.
March 8, 2025 at 11:53 PM
It’s pretty much a straight shoot up into the third dimension for the first 2 tests. However, for the 3rd, instead of projecting a 1D line from a 2D shape as above, we instead project a 2D shape onto a 2D surface. To do this, we decompose the rotated 3D rectangular prism into its composite triangles
March 8, 2025 at 11:50 PM
3. Pick one of the boxes to define a set of axis as areference frame. Rotate the whole world in such a way that one box is now perfectly aligned with the axis. Then, we project to each axis. If any of the projections do not overlap, we can guarantee that the boxes do not overlap either.
March 8, 2025 at 11:48 PM
2. Iterate the points of one of the boxes and check the overlap. If there are any points within the box, the box is overlapping.
March 8, 2025 at 11:47 PM
First lets think about the problem in 2 dimensions. There’s 3 tests we can run to check if these rotated boxes overlap, shown in the diagram above. We run these tests from cheapest => most expensive.
1. Generate two axis-aligned boxes and run a quick AABB check as a broad phase check.
March 8, 2025 at 11:46 PM
It's even got different voxel modes!
March 8, 2025 at 10:30 AM
It's got an editor which is... Functional. Honestly, this thing is made to solve problems, not be pretty, and it's more of a look into how my brain works than a UX design.
March 8, 2025 at 10:29 AM
It's got custom materials per voxel, per surface! Including texture support (using Texture2DArray, which has some platform support implications iirc)
March 8, 2025 at 10:28 AM
It's got mesh optimization!
March 8, 2025 at 10:26 AM