Lines Matching refs:spd
58 std::tuple<SkScalar, SkScalar> find_yintercept(const SkPoint& pos, const SkVector& spd, in find_yintercept() argument
60 const SkScalar edge = spd.fX > 0 ? box.fRight : box.fLeft; in find_yintercept()
61 const SkScalar t = (edge - pos.fX) / spd.fX; in find_yintercept()
63 const SkScalar dY = t * spd.fY; in find_yintercept()
231 spd = s; in initialize()
236 pos += spd * dt; in posTick()
254 SkVector spd; member
261 fBall.spd.fY = -fBall.spd.fY; in enforceConstraints()
267 fBall.spd.fX = this->fuzzBallSpeed(-fBall.spd.fX); in enforceConstraints()
268 fBall.spd.fY = this->fuzzBallSpeed(fBall.spd.fY); in enforceConstraints()
274 SkScalar fuzzBallSpeed(SkScalar spd) { in fuzzBallSpeed() argument
276 const SkScalar sign = spd >= 0 ? 1.0f : -1.0f; in fuzzBallSpeed()
277 const SkScalar fuzzed = fabs(spd) + fRand.nextRangeScalar(-kBallSpeedFuzz, kBallSpeedFuzz); in fuzzBallSpeed()
283 Object* pitcher = fBall.spd.fX > 0 ? &fPaddle0 : &fPaddle1; in updatePaddleStrategy()
284 Object* catcher = fBall.spd.fX > 0 ? &fPaddle1 : &fPaddle0; in updatePaddleStrategy()
287 std::tie(t, yIntercept) = find_yintercept(fBall.pos, fBall.spd, kBounds); in updatePaddleStrategy()
290 pitcher->spd.fY = (kBounds.centerY() - pitcher->pos.fY) / t; in updatePaddleStrategy()
293 catcher->spd.fY = (yIntercept - catcher->pos.fY) / t; in updatePaddleStrategy()