4 ms·
For keeping things from falling through, you need to project the movement vector onto the plane. That means sqrt of magnitude and dot product. If you keep doing
by fxtentacle 5y ago
For keeping things from falling through, you need to project the movement vector onto the plane. That means sqrt of magnitude and dot product. If you keep doing that every frame, a lot of tiny and otherwise insignificant floating point errors are going to sum up.
The correct approach is to not model the floor as thin sheet geometry but instead to model it as solid objects, e.g. the CSG approach used in Quake, Half-Life 1 and Unreal 1 & 2. I believe those games didn't have any falling through bugs.
- foxfluff 5y agohttps://wiki.beyondunreal.com/Legacy:BSP_Hole https://wiki.beyondunreal.com/Legacy:BSP_Hole
- fxtentacle 5y agoAlso there, I believe the underlying issue is lack of floating point precision. That's why the fix is to nudge the brush a bit and/or move it back onto the integer grid.
- thaumasiotes 5y ago> The correct approach is to not model the floor as thin sheet geometry but instead to model it as solid objects, e.g. the CSG approach used in Quake, Half-Life 1 and Unreal 1 & 2. While I never actually did any level editing, I did read a guide to the Unreal Tournament level editor, which said that UT was unusual in that a blank level was filled with mass and the level creation process involved subtracting that away to create empty space, rather than adding objects to an empty void. Related?
- fxtentacle 5y agoYes and no. The Unreal approach makes it easy to create levels with a waterproof outer hull which allows you to use certain optimizations (such as portals in the BSP tree) to reduce what you need to draw. But even without that, CSG usually produces only geometry that has a thickness, and that's what helps with the sliding through floors in the first place. But since the Unreal approach makes it very easy to query if a point is inside the valid space of the level, or not, that's also used as a shortcut for determining if things did fall through somewhere. So yes, the "blank filled with mass" approach further reduces the problem but no, it's not strictly necessary.