Lines Matching refs:spd
60 std::tuple<SkScalar, SkScalar> find_yintercept(const SkPoint& pos, const SkVector& spd, in find_yintercept() argument
62 const SkScalar edge = spd.fX > 0 ? box.fRight : box.fLeft; in find_yintercept()
63 const SkScalar t = (edge - pos.fX) / spd.fX; in find_yintercept()
65 const SkScalar dY = t * spd.fY; in find_yintercept()
230 spd = s; in initialize()
235 pos += spd * dt; in posTick()
253 SkVector spd; member
260 fBall.spd.fY = -fBall.spd.fY; in enforceConstraints()
266 fBall.spd.fX = this->fuzzBallSpeed(-fBall.spd.fX); in enforceConstraints()
267 fBall.spd.fY = this->fuzzBallSpeed(fBall.spd.fY); in enforceConstraints()
273 SkScalar fuzzBallSpeed(SkScalar spd) { in fuzzBallSpeed() argument
275 const SkScalar sign = spd >= 0 ? 1.0f : -1.0f; in fuzzBallSpeed()
276 const SkScalar fuzzed = fabs(spd) + fRand.nextRangeScalar(-kBallSpeedFuzz, kBallSpeedFuzz); in fuzzBallSpeed()
282 Object* pitcher = fBall.spd.fX > 0 ? &fPaddle0 : &fPaddle1; in updatePaddleStrategy()
283 Object* catcher = fBall.spd.fX > 0 ? &fPaddle1 : &fPaddle0; in updatePaddleStrategy()
286 std::tie(t, yIntercept) = find_yintercept(fBall.pos, fBall.spd, kBounds); in updatePaddleStrategy()
289 pitcher->spd.fY = (kBounds.centerY() - pitcher->pos.fY) / t; in updatePaddleStrategy()
292 catcher->spd.fY = (yIntercept - catcher->pos.fY) / t; in updatePaddleStrategy()