Quelling the floating point demon in my line rendering code
mortoray.com
mortoray.com
> angle = Collision2D.AngleBetween( lv, bisectNormal )
> if( /*cusp*/ angle < 0.1f || angle > Math.PIf - 0.1f ) {
> //use alternate corner cap
> }
Just a quick note: you might want to use dot product there: if( /*cusp*/ dotProduct(lv, bisectNormal) < 0.1f ) {
//use alternate corner cap
}I tend to do my first code as logically clean and then apply optimizations later. This will likely be replaced by an `IsCusp` function instead, to make it even clearer, and provide a clean place to do the optimization.