3 comments

[ 8.4 ms ] story [ 43.4 ms ] thread

  > 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 know in some situations you can use dot product and it's an optimization I will apply. A bit more care must be taken though. The input must be unit vectors and the output can be positive or negative.

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.

Oh, indeed. I'm a bit embarrassed I didn't consider the need for normalization and the potential negative output :P