@WasserEsser C++
Originally Posted by
ddddddz
when you pass these do you actually use them for manipulation? Like if you are setting viewangles at some other point are you using
angle? Post your Vector3 class please.
I create a Vector3 at the start of my CreateMove hook, use it in my aimbot and antiaim, at the end of CreateMove I clamp it and then I do this:
pCmd->viewangles = Angle
Angle is the angle I created at the start of my CreateMove hook obviously.
Code:
class Vector3
{
public:
float x, y, z;
inline Vector3()
: x(0),
y(0),
z(0)
{
}
inline Vector3(float X, float Y, float Z)
: x(X),
y(Y),
z(Z)
{
}
inline Vector3(float XYZ)
: x(XYZ),
y(XYZ),
z(XYZ)
{
}
inline Vector3(float* v)
: x(v[0]),
y(v[1]),
z(v[2])
{
}
inline Vector3(const float* v)
: x(v[0]),
y(v[1]),
z(v[2])
{
}
inline void Init(float X = 0.0f, float Y = 0.0f, float Z = 0.0f)
{
x = X;
y = Y;
z = Z;
}
inline float operator [] (int i) const
{
return ((float*)this)[i];
}
inline float& operator [] (int i)
{
return ((float*)this)[i];
}
inline Vector3& operator += (const Vector3& v)
{
x += v.x;
y += v.y;
z += v.z;
return *this;
}
inline Vector3& operator -= (const Vector3& v)
{
x -= v.x;
y -= v.y;
z -= v.z;
return *this;
}
inline Vector3& operator *= (const Vector3& v)
{
x *= v.x;
y *= v.y;
z *= v.z;
return *this;
}
inline Vector3& operator /= (const Vector3& v)
{
x /= v.x;
y /= v.y;
z /= v.z;
return *this;
}
inline Vector3& operator += (float v)
{
x += v;
y += v;
z += v;
return *this;
}
inline Vector3& operator -= (float v)
{
x -= v;
y -= v;
z -= v;
return *this;
}
inline Vector3& operator *= (float v)
{
x *= v;
y *= v;
z *= v;
return *this;
}
inline Vector3& operator /= (float v)
{
x /= v;
y /= v;
z /= v;
return *this;
}
inline Vector3 operator - () const
{
return Vector3(-x, -y, -z);
}
inline Vector3 operator - (const Vector3& v) const
{
return Vector3(x - v.x, y - v.y, z - v.z);
}
inline Vector3 operator + (const Vector3& v) const
{
return Vector3(x + v.x, y + v.y, z + v.z);
}
inline Vector3 operator * (const Vector3& v) const
{
return Vector3(x * v.x, y * v.y, z * v.z);
}
inline Vector3 operator / (const Vector3& v) const
{
return Vector3(x / v.x, y / v.y, z / v.z);
}
inline float Length() const
{
return sqrtf(x * x + y * y + z * z);
}
inline float LengthSqr() const
{
return (x * x + y * y + z * z);
}
inline float LengthXY() const
{
return sqrtf(x * x + y * y);
}
inline float LengthXZ() const
{
return sqrtf(x * x + z * z);
}
inline bool IsZero() const
{
return (x > -0.01f && x < 0.01f
&& y > -0.01f && y < 0.01f
&& z > -0.01f && z < 0.01f);
}
inline float DistTo(const Vector3& v) const
{
return (*this - v).Length();
}
inline float DistToSqr(const Vector3& v) const
{
return (*this - v).LengthSqr();
}
inline float Dot(const Vector3& v) const
{
return (x * v.x + y * v.y + z * v.z);
}
inline Vector3 Cross(const Vector3& v) const
{
return Vector3(y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x);
}
};