spring wind update

This commit is contained in:
Turanszki Janos
2020-04-11 13:26:52 +01:00
parent 397a34fb64
commit 1935dd8471
2 changed files with 3 additions and 4 deletions
+2 -3
View File
@@ -1802,7 +1802,7 @@ namespace wiScene
{
static float time = 0;
time += dt;
const XMVECTOR wind = XMLoadFloat3(&weather.windDirection);
const XMVECTOR windDir = XMLoadFloat3(&weather.windDirection);
const XMVECTOR gravity = XMVectorSet(0, -9.8f, 0, 0);
for (size_t i = 0; i < springs.GetCount(); ++i)
@@ -1843,8 +1843,7 @@ namespace wiScene
if (spring.wind_affection > 0)
{
// todo: nicer wind calculation
force += spring.wind_affection * wind * XMVectorSin(position_current + XMVectorReplicate(time*XM_2PI)) * 0.5f + XMVectorReplicate(0.5f);
force += std::sin(time * weather.windSpeed + XMVectorGetX(XMVector3Dot(position_current, windDir))) * windDir * spring.wind_affection;
}
if (spring.IsGravityEnabled())
{
+1 -1
View File
@@ -9,7 +9,7 @@ namespace wiVersion
// minor features, major updates
const int minor = 39;
// minor bug fixes, alterations, refactors, updates
const int revision = 51;
const int revision = 52;
long GetVersion()