コード例 #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);