Esempio n. 1
0
    public static Angle2 operator *(Angle2 L, Angle2 R)
    {
        Vector2 l      = L.m;
        Angle2  angle2 = Angle2.Delta(L, R);

        L.m = l + angle2.m;
        return(L);
    }
Esempio n. 2
0
    public bool SampleWorldVelocity(double time, out Vector3 worldLinearVelocity, out Angle2 worldAngularVelocity)
    {
        int num;
        int num1 = this.len;

        if (num1 == 0 || num1 == 1)
        {
            worldLinearVelocity  = new Vector3();
            worldAngularVelocity = new Angle2();
            return(false);
        }
        int num2 = 0;
        int num3 = -1;

        do
        {
            int    num4 = this.tbuffer[num2].index;
            double num5 = this.tbuffer[num4].timeStamp;
            if (num5 <= time)
            {
                if (num3 == -1)
                {
                    worldLinearVelocity  = new Vector3();
                    worldAngularVelocity = new Angle2();
                    return(false);
                }
                double num6 = this.tbuffer[num3].timeStamp;
                double num7 = (double)this.allowableTimeSpan + NetCull.sendInterval;
                double num8 = num6 - num5;
                if (num8 >= num7)
                {
                    num8 = num7;
                    num5 = num6 - num8;
                    if (time <= num5)
                    {
                        worldLinearVelocity  = new Vector3();
                        worldAngularVelocity = new Angle2();
                        return(false);
                    }
                }
                worldLinearVelocity    = this.tbuffer[num3][email protected] - this.tbuffer[num4][email protected];
                worldAngularVelocity   = Angle2.Delta(this.tbuffer[num4][email protected], this.tbuffer[num3][email protected]);
                worldLinearVelocity.x  = (float)((double)worldLinearVelocity.x / num8);
                worldLinearVelocity.y  = (float)((double)worldLinearVelocity.y / num8);
                worldLinearVelocity.z  = (float)((double)worldLinearVelocity.z / num8);
                worldAngularVelocity.x = (float)((double)worldAngularVelocity.x / num8);
                worldAngularVelocity.y = (float)((double)worldAngularVelocity.y / num8);
                return(true);
            }
            num3 = num4;
            num  = num2 + 1;
            num2 = num;
        }while (num < this.len);
        worldLinearVelocity  = new Vector3();
        worldAngularVelocity = new Angle2();
        return(false);
    }
Esempio n. 3
0
    public bool SampleWorldVelocity(double time, out Vector3 worldLinearVelocity, out Angle2 worldAngularVelocity)
    {
        switch (base.len)
        {
        case 0:
        case 1:
            worldLinearVelocity  = new Vector3();
            worldAngularVelocity = new Angle2();
            return(false);
        }
        int index = 0;
        int num4  = -1;

        do
        {
            int    num       = base.tbuffer[index].index;
            double timeStamp = base.tbuffer[num].timeStamp;
            if (timeStamp > time)
            {
                num4 = num;
            }
            else
            {
                if (num4 == -1)
                {
                    worldLinearVelocity  = new Vector3();
                    worldAngularVelocity = new Angle2();
                    return(false);
                }
                double num5 = base.tbuffer[num4].timeStamp;
                double num6 = base.allowableTimeSpan + NetCull.sendInterval;
                double num7 = num5 - timeStamp;
                if (num7 >= num6)
                {
                    num7      = num6;
                    timeStamp = num5 - num7;
                    if (time <= timeStamp)
                    {
                        worldLinearVelocity  = new Vector3();
                        worldAngularVelocity = new Angle2();
                        return(false);
                    }
                }
                worldLinearVelocity    = base.tbuffer[num4].value.origin - base.tbuffer[num].value.origin;
                worldAngularVelocity   = Angle2.Delta(base.tbuffer[num].value.eyesAngles, base.tbuffer[num4].value.eyesAngles);
                worldLinearVelocity.x  = (float)(((double)worldLinearVelocity.x) / num7);
                worldLinearVelocity.y  = (float)(((double)worldLinearVelocity.y) / num7);
                worldLinearVelocity.z  = (float)(((double)worldLinearVelocity.z) / num7);
                worldAngularVelocity.x = (float)(((double)worldAngularVelocity.x) / num7);
                worldAngularVelocity.y = (float)(((double)worldAngularVelocity.y) / num7);
                return(true);
            }
        }while (++index < base.len);
        worldLinearVelocity  = new Vector3();
        worldAngularVelocity = new Angle2();
        return(false);
    }