| 295 | } |
| 296 | |
| 297 | Vector3Val ClothObject::GetNormal(float x, float y) const |
| 298 | { |
| 299 | int xInt = toInt(x * (_knots.W() - 1)); |
| 300 | int yInt = toInt(y * (_knots.H() - 1)); |
| 301 | saturate(xInt, 0, _knots.W() - 1); |
| 302 | saturate(yInt, 0, _knots.H()); |
| 303 | const ClothKnot& knot = _knots.Get(xInt, yInt); |
| 304 | return knot._norm; |
| 305 | } |
| 306 | |
| 307 | } // namespace Poseidon |