OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/android/vr_shell/easing.h" |
| 6 |
| 7 namespace vr_shell { |
| 8 namespace easing { |
| 9 |
| 10 CubicBezier::CubicBezier(double p1x, double p1y, double p2x, double p2y) |
| 11 : bezier(p1x, p1y, p2x, p2y) {} |
| 12 double CubicBezier::CalculateValue(double state) { |
| 13 return bezier.Solve(state); |
| 14 } |
| 15 |
| 16 EaseIn::EaseIn(double power) : mPower(power) {} |
| 17 double EaseIn::CalculateValue(double state) { |
| 18 return pow(state, mPower); |
| 19 } |
| 20 |
| 21 EaseOut::EaseOut(double power) : mPower(power) {} |
| 22 double EaseOut::CalculateValue(double state) { |
| 23 return 1.0 - pow(1.0 - state, mPower); |
| 24 } |
| 25 |
| 26 double Linear::CalculateValue(double state) { |
| 27 return state; |
| 28 } |
| 29 |
| 30 } // namespace easing |
| 31 } // namespace vr_shell |
OLD | NEW |