示例#1
0
        public static ushort CalculateAngleFromInputs(int xInput, int yInput, ushort?cameraAngleNullable = null)
        {
            (float effectiveX, float effectiveY) = GetEffectiveInput(xInput, yInput);
            ushort marioAngle     = InGameTrigUtilities.InGameATan(effectiveY, -effectiveX);
            ushort cameraAngleRaw = cameraAngleNullable ?? Config.Stream.GetUInt16(CameraConfig.StructAddress + CameraConfig.CentripetalAngleOffset);
            ushort cameraAngle    = NormalizeAngleUshort(ReverseAngle(cameraAngleRaw));
            ushort summedAngle    = NormalizeAngleUshort(marioAngle + cameraAngle);

            return(summedAngle);
        }
示例#2
0
        public static void TestSomething2()
        {
            List <string> output = new List <string>();

            for (int i = 0; i < 65536; i++)
            {
                float trig2 = InGameTrigUtilities.InGameCosine(i);
            }
            InfoForm.ShowValue(String.Join("\r\n", output));
        }
        static BitfsPlatformGroupTable()
        {
            _relativeHeights = new float[256];
            float height = _testStartingHeight;
            int   timer  = 0;

            for (int i = 0; i < 256; i++)
            {
                _relativeHeights[i] = height - _testStartingHeight;
                height += InGameTrigUtilities.InGameSine(timer) * -0.58f;
                timer  += 0x100;
            }
            _heightRange = _relativeHeights.Max() - _relativeHeights.Min();
        }