| 491 | } |
| 492 | |
| 493 | Vector3f normal( const MeshTopology & topology, const VertCoords & points, const MeshTriPoint & p ) |
| 494 | { |
| 495 | if ( p.bary.b == 0 ) |
| 496 | { |
| 497 | // do not require to have triangular face to the left of p.e |
| 498 | const Vector3f n0 = normal( topology, points, topology.org( p.e ) ); |
| 499 | const Vector3f n1 = normal( topology, points, topology.dest( p.e ) ); |
| 500 | return lerp( n0, n1, p.bary.a ).normalized(); |
| 501 | } |
| 502 | VertId a, b, c; |
| 503 | topology.getLeftTriVerts( p.e, a, b, c ); |
| 504 | auto n0 = normal( topology, points, a ); |
| 505 | auto n1 = normal( topology, points, b ); |
| 506 | auto n2 = normal( topology, points, c ); |
| 507 | return p.bary.interpolate( n0, n1, n2 ).normalized(); |
| 508 | } |
| 509 | |
| 510 | Vector3f pseudonormal( const MeshTopology & topology, const VertCoords & points, VertId v, const FaceBitSet * region ) |
| 511 | { |
no test coverage detected