| 12 | |
| 13 | namespace VoxelVolumeAttributeHelper { |
| 14 | Float compute_signed_tet_volume( |
| 15 | const Vector3F& v0, const Vector3F& v1, |
| 16 | const Vector3F& v2, const Vector3F& v3) { |
| 17 | // Formula: volume = <a x b, c> / 6 |
| 18 | // where a,b and c are edge vector from a single vertex. |
| 19 | // <., .> is inner product. |
| 20 | return ((v1 - v0).cross(v2 - v0)).dot(v3 - v0) / 6.0; |
| 21 | } |
| 22 | |
| 23 | Float compute_abs_tet_volume( |
| 24 | const Vector3F& v0, const Vector3F& v1, |
no outgoing calls
no test coverage detected