===================== CM_PlaneFromPoints Returns false if the triangle is degenrate. The normal will point out of the clock for clockwise ordered points ===================== */
| 151 | ===================== |
| 152 | */ |
| 153 | static qboolean CM_PlaneFromPoints( vec4_t plane, vec3_t a, vec3_t b, vec3_t c ) { |
| 154 | vec3_t d1, d2; |
| 155 | |
| 156 | VectorSubtract( b, a, d1 ); |
| 157 | VectorSubtract( c, a, d2 ); |
| 158 | CrossProduct( d2, d1, plane ); |
| 159 | if ( VectorNormalize( plane ) == 0 ) { |
| 160 | return qfalse; |
| 161 | } |
| 162 | |
| 163 | plane[3] = DotProduct( a, plane ); |
| 164 | return qtrue; |
| 165 | } |
| 166 | |
| 167 | |
| 168 | /* |
no test coverage detected