Пример #1
0
        public LTVectorFloat GetPlayerPos(int index)
        {
            LTVectorFloat result = null;
            IntPtr        PlayerObjectPtrAddress = GetPlayerObjectPtrAddress(index);
            IntPtr        PlayerObjectPtr        = IntPtr.Add(IntPtr.Zero, BitConverter.ToInt32(ReadMem(PlayerObjectPtrAddress), 0));

            if (PlayerObjectPtr != IntPtr.Zero)
            {
                result = new LTVectorFloat
                {
                    X = BitConverter.ToSingle(ReadMem(IntPtr.Add(PlayerObjectPtr, 0xE8)), 0),
                    Y = BitConverter.ToSingle(ReadMem(IntPtr.Add(PlayerObjectPtr, 0xEC)), 0),
                    Z = BitConverter.ToSingle(ReadMem(IntPtr.Add(PlayerObjectPtr, 0xF0)), 0)
                };
            }
            return(result);
        }
Пример #2
0
 public float DistSqr(LTVectorFloat b) => Subtract(b).LengthSqr();
Пример #3
0
 public float Dist(LTVectorFloat b) => Subtract(b).Length();
Пример #4
0
 public float Dot(LTVectorFloat b) => X * b.X + Y * b.Y + Z * b.Z;
Пример #5
0
 public LTVectorFloat Subtract(LTVectorFloat b) => new LTVectorFloat(X - b.X, Y - b.Y, Z - b.Z);
Пример #6
0
 public LTVectorFloat Cross(LTVectorFloat b) => new LTVectorFloat(Y * b.Z - Z * b.Y, Z * b.X - X * b.Z, X * b.Y - Y * b.X);