MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / InitPos

Method InitPos

engine/Poseidon/World/Simulation/Cloth/ClothObject.cpp:46–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46void 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

Callers

nothing calls this directly

Calls 4

WMethod · 0.45
HMethod · 0.45
RotateMethod · 0.45
FastTransformMethod · 0.45

Tested by

no test coverage detected