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:
parent
70b4c3baad
commit
d2d7ce6e31
|
@ -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) +
|
||||||
|
|
Loading…
Reference in New Issue