20 namespace deformation {
23 const float A1 = 0.6f;
24 const float A2 = 1.1f;
26 const float F1 = 1000.0;
27 const float F2 = -1500.0;
29 const float Kx1 = 0.035f;
30 const float Kx2 = 0.02f;
32 const float Ky1 = -0.08f;
33 const float Ky2 = 0.05f;
35 return A1 * sin((Kx1 * posx + Ky1 * posy + F1)) +
36 A2 * sin((Kx2 * posx + Ky2 * posy + F2));
40 const float A3 = 0.10f;
41 float bumpsoffset = 0;
43 float constraintX = 17.0f;
44 float constraintY = 12.0f;
46 float BumpX = std::ceil(posx / constraintX);
47 float BumpY = std::floor(posy / constraintY);
52 float DistanceToBumpOrigin = sqrt(pow(BumpX - posx, 2) + pow(BumpY - posy, 2) );
53 float MaxDistance = 2.0;
55 if (DistanceToBumpOrigin <= MaxDistance) {
56 bumpsoffset = sin(DistanceToBumpOrigin);
59 return A3 * bumpsoffset;
This file contains definitions of common data structures used in traffic manager. ...