Skip to content

Commit 02ac3a0

Browse files
iTris666julienf-unity
authored andcommitted
Simplify linear drag (#67)
* Simplify linear drag * Fix warning
1 parent e0c8262 commit 02ac3a0

File tree

1 file changed

+3
-3
lines changed
  • com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Forces

1 file changed

+3
-3
lines changed

com.unity.visualeffectgraph/Editor/Models/Blocks/Implementations/Forces/Drag.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ public override string source
5454
string source = string.Empty;
5555
if (UseParticleSize)
5656
{
57-
source = string.Format(@"
58-
float2 side = {0};
57+
source = @"
58+
float2 side = size * float2(scaleX, scaleY);
5959
dragCoefficient *= side.x * side.y;
60-
", UseParticleSize ? "size * (scaleX, scaleY)" : VFXAttribute.kDefaultSize + " * float2(1, 1)");
60+
";
6161
}
6262

6363
return source + "velocity *= max(0.0,(1.0 - (dragCoefficient * deltaTime) / mass));";

0 commit comments

Comments
 (0)