////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// * Computes a point on the triangle according to the stabbing information. * \param u,v [in] point's barycentric coordinates * \param pt [out] point on triangle * \param nearvtx [out] index of ne
| 248 | */ |
| 249 | /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 250 | void Triangle::ComputePoint(float u, float v, Point& pt, udword* nearvtx) const |
| 251 | { |
| 252 | // Compute point coordinates |
| 253 | pt = (1.0f - u - v)*mVerts[0] + u*mVerts[1] + v*mVerts[2]; |
| 254 | |
| 255 | // Compute nearest vertex if needed |
| 256 | if(nearvtx) |
| 257 | { |
| 258 | // Compute distance vector |
| 259 | Point d(mVerts[0].SquareDistance(pt), // Distance^2 from vertex 0 to point on the face |
| 260 | mVerts[1].SquareDistance(pt), // Distance^2 from vertex 1 to point on the face |
| 261 | mVerts[2].SquareDistance(pt)); // Distance^2 from vertex 2 to point on the face |
| 262 | |
| 263 | // Get smallest distance |
| 264 | *nearvtx = d.SmallestAxis(); |
| 265 | } |
| 266 | } |
| 267 | |
| 268 | void Triangle::Inflate(float fat_coeff, bool constant_border) |
| 269 | { |
nothing calls this directly
no test coverage detected