MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/FleX / UpdateWind

Function UpdateWind

demo/main.cpp:1159–1177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1157}
1158
1159void UpdateWind()
1160{
1161 g_windTime += g_dt;
1162
1163 const Vec3 kWindDir = Vec3(3.0f, 15.0f, 0.0f);
1164 const float kNoise = Perlin1D(g_windTime*g_windFrequency, 10, 0.25f);
1165 Vec3 wind = g_windStrength*kWindDir*Vec3(kNoise, fabsf(kNoise), 0.0f);
1166
1167 g_params.wind[0] = wind.x;
1168 g_params.wind[1] = wind.y;
1169 g_params.wind[2] = wind.z;
1170
1171 if (g_wavePool)
1172 {
1173 g_waveTime += g_dt;
1174
1175 g_params.planes[2][3] = g_wavePlane + (sinf(float(g_waveTime)*g_waveFrequency - kPi*0.5f)*0.5f + 0.5f)*g_waveAmplitude;
1176 }
1177}
1178
1179void SyncScene()
1180{

Callers 1

UpdateFrameFunction · 0.85

Calls 1

Perlin1DFunction · 0.85

Tested by

no test coverage detected