Fixup computeboids example.

This Cl converts the cast in computeboids to a type constructor.

Change-Id: Ie1e7183226bb2f629f25cb2d35fc917d8ca68564
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/29140
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
dan sinclair 2020-09-30 14:00:10 +00:00 committed by Commit Bot service account
parent 70b4c3baad
commit d2d7ce6e31
1 changed files with 2 additions and 2 deletions

View File

@ -105,10 +105,10 @@ fn comp_main() -> void {
} }
if (cMassCount > 0) { if (cMassCount > 0) {
cMass = cMass =
(cMass / vec2<f32>(cast<f32>(cMassCount), cast<f32>(cMassCount))) - vPos; (cMass / vec2<f32>(f32(cMassCount), f32(cMassCount))) - vPos;
} }
if (cVelCount > 0) { if (cVelCount > 0) {
cVel = cVel / vec2<f32>(cast<f32>(cVelCount), cast<f32>(cVelCount)); cVel = cVel / vec2<f32>(f32(cVelCount), f32(cVelCount));
} }
vVel = vVel + (cMass * params.rule1Scale) + (colVel * params.rule2Scale) + vVel = vVel + (cMass * params.rule1Scale) + (colVel * params.rule2Scale) +