| 1 | #include "Player/PlayerJudgeStartWaterSurfaceRun.h" |
|---|---|
| 2 | |
| 3 | #include "Library/LiveActor/ActorMovementFunction.h" |
| 4 | #include "Library/LiveActor/ActorPoseUtil.h" |
| 5 | #include "Library/Math/MathUtil.h" |
| 6 | #include "Library/Nature/WaterSurfaceFinder.h" |
| 7 | |
| 8 | #include "Player/PlayerCounterForceRun.h" |
| 9 | |
| 10 | PlayerJudgeStartWaterSurfaceRun::PlayerJudgeStartWaterSurfaceRun( |
| 11 | const al::LiveActor* player, const al::WaterSurfaceFinder* waterSurfaceFinder, |
| 12 | const PlayerCounterForceRun* counterForceRun) |
| 13 | : mPlayer(player), mWaterSurfaceFinder(waterSurfaceFinder), mCounterForceRun(counterForceRun) {} |
| 14 | |
| 15 | bool PlayerJudgeStartWaterSurfaceRun::judge() const { |
| 16 | return mCounterForceRun->getCounter() > 0 && mWaterSurfaceFinder->isFoundSurface() && |
| 17 | al::isNearZeroOrGreater(value: mWaterSurfaceFinder->getDistance()) && |
| 18 | al::getGravity(actor: mPlayer).dot(t: al::getVelocity(actor: mPlayer)) > 0.0f; |
| 19 | } |
| 20 |