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