| 285 | } |
| 286 | |
| 287 | Vector3Val ClothObject::GetPosition(float x, float y) const |
| 288 | { |
| 289 | int xInt = toInt(x * (_knots.W() - 1)); |
| 290 | int yInt = toInt(y * (_knots.H() - 1)); |
| 291 | saturate(xInt, 0, _knots.W() - 1); |
| 292 | saturate(yInt, 0, _knots.H() - 1); |
| 293 | const ClothKnot& knot = _knots.Get(xInt, yInt); |
| 294 | return knot._pos; |
| 295 | } |
| 296 | |
| 297 | Vector3Val ClothObject::GetNormal(float x, float y) const |
| 298 | { |