예제 #1
0
 public void onBallLanded(FixVector2 point, bool pass, int times, FixVector3 velocity, Fix64 preHeightVelocity)
 {
     fbGame.generateRenderAction <RAL.BallLandedAction>(point.toVector2(), pass, times, velocity.toVector3(), (float)preHeightVelocity);
 }
예제 #2
0
    public void endSample()
    {
        FixVector2 curPosition = getPosition();
        var        length      = (curPosition - lastPosition).squareLength;
        var        heightDelta = Fix64.Abs(height - lastHeight);

        if (forceCheck || length > (Fix64)0.0001f || height > Fix64.Zero)
        {
            if (height > Fix64.Zero)
            {
                world.fbGame.generateRenderAction <RAL.ActorMovingAction3D>(id, new FixVector3(curPosition.x, height, curPosition.y).toVector3(), ignorePositionSampleSlerp, (uint)defendMoveDirection);
            }
            else
            {
                world.fbGame.generateRenderAction <RAL.ActorMovingAction>(id, new FixVector2(curPosition.x, curPosition.y).toVector2(), ignorePositionSampleSlerp, (uint)defendMoveDirection);
            }
            if (endMove)
            {
                endMove = false;
            }
        }
        else
        {
            if (!endMove)
            {
                world.fbGame.generateRenderAction <RAL.ActorEndMoveAction>(id);
                endMove = true;
            }
        }

        if (checkMovingState() &&
            particle.velocity != FixVector2.kZero &&
            length <= (Fix64)1e-3)
        {
            world.fbGame.generateRenderAction <RAL.ChangeActorAnimatorSpeedAction>(id, (float)calculateAnimatorSpeedOfRun(0));
        }
        if (ignorePositionSampleSlerp)
        {
            ignorePositionSampleSlerp = false;
        }

        bool sampleDirection = forceCheck || (!ignoreDirectionSample && FixVector2.dot(direction, lastDirection) < Fix64.One && direction != FixVector2.kZero);

        if (sampleDirection)
        {
            world.fbGame.generateRenderAction <RAL.TurningAction>(this.id, lastDirection.toVector2(), direction.toVector2(), ignoreDirectionSlerp);
        }

        if (ignoreDirectionSample)
        {
            ignoreDirectionSample = false;
        }
        if (ignoreDirectionSlerp)
        {
            ignoreDirectionSlerp = false;
        }

        if (forceCheck)
        {
            forceCheck = false;
        }
    }