Ejemplo 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;
    }
Ejemplo n.º 2
0
 public abstract PlayerInterpolationState CastToPlayerInterpolationState(InterpolatedObject a);
Ejemplo n.º 3
0
 public abstract PlayerInterpolationState CastToPlayerInterpolationState(InterpolatedObject a);
Ejemplo 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;
 }
Ejemplo n.º 5
0
 public abstract void AddNetworkPacket(InterpolatedObject c, int timeMilliseconds);
Ejemplo n.º 6
0
 public abstract InterpolatedObject Interpolate(InterpolatedObject a, InterpolatedObject b, float progress);
Ejemplo n.º 7
0
 public override PlayerInterpolationState CastToPlayerInterpolationState(InterpolatedObject a)
 {
     return (PlayerInterpolationState)a;
 }
Ejemplo n.º 8
0
 public abstract void AddNetworkPacket(InterpolatedObject c, int timeMilliseconds);
Ejemplo n.º 9
0
 public abstract InterpolatedObject Interpolate(InterpolatedObject a, InterpolatedObject b, float progress);
Ejemplo 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;
    }