| 44 | } |
| 45 | |
| 46 | void ClothObject::InitPos(Matrix4Val pos, Vector3Val vel) |
| 47 | { |
| 48 | // set initial positions |
| 49 | float xGrid = _xSize / (_knots.W() - 1); |
| 50 | float yGrid = _ySize / (_knots.H() - 1); |
| 51 | Vector3 norm = pos.Rotate(VAside); |
| 52 | for (int y = 0; y < _knots.H(); y++) |
| 53 | { |
| 54 | for (int x = 0; x < _knots.W(); x++) |
| 55 | { |
| 56 | ClothKnot& knot = _knots(x, y); |
| 57 | Vector3 relPos(x * xGrid + _xMin, y * yGrid + _yMin, 0); |
| 58 | knot._pos = pos.FastTransform(relPos); |
| 59 | knot._vel = vel; |
| 60 | knot._norm = norm; |
| 61 | } |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | #define G_CONST 9.8066f |
| 66 |
nothing calls this directly
no test coverage detected