Esempio n. 1
0
    public override void AddNetworkPacket(InterpolatedObject c, int timeMilliseconds)
    {
        Packet_ p = new Packet_();

        p.content = c;
        p.timestampMilliseconds = timeMilliseconds;

        int max = 100;

        if (receivedCount >= max)
        {
            for (int i = 0; i < max - 1; i++)
            {
                received[i] = received[i + 1];
            }
            receivedCount = max - 1;
        }

        received[receivedCount++] = p;
    }
Esempio n. 2
0
 public abstract PlayerInterpolationState CastToPlayerInterpolationState(InterpolatedObject a);
Esempio n. 3
0
 public abstract PlayerInterpolationState CastToPlayerInterpolationState(InterpolatedObject a);
Esempio n. 4
0
 public override InterpolatedObject Interpolate(InterpolatedObject a, InterpolatedObject b, float progress)
 {
     PlayerInterpolationState aa = platform.CastToPlayerInterpolationState(a);
     PlayerInterpolationState bb = platform.CastToPlayerInterpolationState(b);
     PlayerInterpolationState cc = new PlayerInterpolationState();
     cc.positionX = aa.positionX + (bb.positionX - aa.positionX) * progress;
     cc.positionY = aa.positionY + (bb.positionY - aa.positionY) * progress;
     cc.positionZ = aa.positionZ + (bb.positionZ - aa.positionZ) * progress;
     //cc.heading = Game.IntToByte(AngleInterpolation.InterpolateAngle256(platform, aa.heading, bb.heading, progress));
     //cc.pitch = Game.IntToByte(AngleInterpolation.InterpolateAngle256(platform, aa.pitch, bb.pitch, progress));
     cc.rotx = DegToRad(AngleInterpolation.InterpolateAngle360(platform, RadToDeg(aa.rotx), RadToDeg(bb.rotx), progress));
     cc.roty = DegToRad(AngleInterpolation.InterpolateAngle360(platform, RadToDeg(aa.roty), RadToDeg(bb.roty), progress));
     cc.rotz = DegToRad(AngleInterpolation.InterpolateAngle360(platform, RadToDeg(aa.rotz), RadToDeg(bb.rotz), progress));
     return cc;
 }
Esempio n. 5
0
 public abstract void AddNetworkPacket(InterpolatedObject c, int timeMilliseconds);
Esempio n. 6
0
 public abstract InterpolatedObject Interpolate(InterpolatedObject a, InterpolatedObject b, float progress);
Esempio n. 7
0
 public override PlayerInterpolationState CastToPlayerInterpolationState(InterpolatedObject a)
 {
     return (PlayerInterpolationState)a;
 }
 public abstract void AddNetworkPacket(InterpolatedObject c, int timeMilliseconds);
 public abstract InterpolatedObject Interpolate(InterpolatedObject a, InterpolatedObject b, float progress);
Esempio n. 10
0
    public override void AddNetworkPacket(InterpolatedObject c, int timeMilliseconds)
    {
        Packet_ p = new Packet_();
        p.content = c;
        p.timestampMilliseconds = timeMilliseconds;

        int max = 100;
        if (receivedCount >= max)
        {
            for (int i = 0; i < max - 1; i++)
            {
                received[i] = received[i + 1];
            }
            receivedCount = max - 1;
        }

        received[receivedCount++] = p;
    }