| 26 | } |
| 27 | |
| 28 | FLOATPT NormalVectorCalc(FLOATPT a, FLOATPT b, FLOATPT c) { |
| 29 | FLOATPT v1, v2, out; |
| 30 | |
| 31 | v1.x = c.x - a.x; |
| 32 | v1.y = c.y - a.y; |
| 33 | v1.z = c.z - a.z; |
| 34 | |
| 35 | v2.x = b.x - a.x; |
| 36 | v2.y = b.y - a.y; |
| 37 | v2.z = b.z - a.z; |
| 38 | |
| 39 | out.x = (v1.y * v2.z) - (v1.z * v2.y); |
| 40 | out.y = (v1.z * v2.x) - (v1.x * v2.z); |
| 41 | out.z = (v1.x * v2.y) - (v1.y * v2.x); |
| 42 | |
| 43 | return VectorNormalize(out); |
| 44 | } |
| 45 | |
| 46 | FLOATPT QuadNormalVectorCalc(FLOATPT a, FLOATPT b, FLOATPT c, FLOATPT d) { |
| 47 | struct FLOATPT n1, n2, nc; |
no test coverage detected