Simple Aimbot

Posts 46–51 of 51 · Page 4 of 4
i recommend you search up on sin, cos, and tan.
Nice tutorial
Quote Originally Posted by hackzerz View Post
lol no, i need a redtube aimbot, im spraying like a noob
ahh lol... where you wanna aim
Quote Originally Posted by kibbles18 View Post
[PART 1]
Requirements:
Reclass / structbuild
Ollydbg
A brain

Strongly Recommended:
knowledge of asm/ reversing (watch lena151 tuts)
a knowledge of c++

Ok, so I decided to try and make a simple aimbot tutorial, because the only other one is very outdated. My sample game will be AssualtCube.

The first step to building your aimbot is to obtain the player's data. To do this, you can use a debugger or dissasembler. Im using Ollydbg.

First step : Look for logical places where data specific to each player would be needed, such as a scoreboard, team, etc. In assualtcube, i found it with a text string called "player %s disconnected".

%s is basically a string that will not remain constant. Looking above it, i see an array. arrays look like this in asm:
Code:
EDX+EAX*4
EAX is the index of the particular data ( like [1] or[2] ).
ofcourse it could be any registers. Right above the string i found, i see a PUSH EAX. So that means that the EAX holds the string for the players name, or %s. So im guessing that EDX is the start of the array, and EAX is the index of the player*4 (4 is the number of bytes a pointer is). So the table of all the players is stored at whatever EDX is, and in this case it's (hex )4E4E08.

For this step you will need reclass or structbuild. Attatch it to your game while in a game with other players, and add a new class, and make the address your base (4E4E08 in my case).





When i put myn in, i saw that the first line was a pointer to a place in memory, thanks to reclass's comments.
So click on the little "P" on the left side, indicating a pointer to a new class, with the line selected.



I saw an array of pointers, so i did another class pointer to a random one, and saw data that was changing, and that was float. I could tell it was float, because it wasn't huge or tiny, and it had changing values, so i could tell it was a position. I confirmed this by noticing 2 more variables directly following the first, so it would be an XYZ coordinate. So click on the "float" button to remember that it is a float, and name it X. Do the same for the following 2, but call them Y and Z.




Now if you scroll down and look at other values, you will find yaw/pitch not too far down. I will let u find those.

After we have completed reversing the player class, let's name the class's (same way u named X Y Z) and view the header.


Mine looked like this:

We have a bit of changing to do! Change the pointer to an array of pointers, my assualtcube has 32. Rename the things that were not what you wanted them to say. i renamed the cPlayer* IDEADSLEAWLwhatever to this, becuase the original name dosen't make since, and it is an array:


So you may be wondering, what are classes used for?
Well, ill give you an example. You have a player pointer at hex 12345. You need to add 123 to it to get the x position. You could make the code cleaner and easier by instead addding a class with a char array of 123 in the very front of the class, and have cast the player pointer as a type of your class.
Code:
class player
{
public:
char offset[123]; //chars are used, because they're 1 byte, making it easy
float x;
}
player* myplayer = (player*)0x12345;
myplayer->x = 100; // same as *(float*)(0x12345 + 123) = 100;
A crucial thing to understand about classes is that it is all about the size of the member. So a float x, y, z in a row could be declared as any class with the only memebers being 3 floats. "vec" is a class that has 3 float types. THe class size is 12, and the size of float x, y,z is also 12. COMPATIBLE! same with D3DXVECTOR3. So you can change the float x, y, z to one line of D3DXVECTOR3 pos, or vec pos. (vec is a custom class, i will post it later on).[END OF PART 1]
[PART 2]So now we are finished with reversing the player table and class. We need our own class now.
Look for things unique to you.



I found a txt string in assultcube that says "your name is: %s". %s would be my name. Look above that and you'll see a string called "unarmed", which is the defualt name. Above that, we see a address of 4E4DBC. Something at address 0x4E4DBC + 0x219 is compared to 0. If it is 0, it calls a function, which im guessing is to set your name to unarmed. so 4E4DBC is your player base class, and 0x219 is the offset for your name. Now the class that 4E4DBC points to is the same as the other player's classes I found. So we don't need to open reclass up. Just remeber that 4E4DBC points to the start of our player's class.

So we now have all the data we need to make the aimbot (A way of getting other player's XYZ, our XYZ, and our pitch/yaw). My finished classes look like this:
Code:
class cPlayer;
class cPlayerTable;
struct vec;

struct vec
{
    union
    {
        struct { float x, y, z; };
        float v[3];
        int i[3];
    };

    vec() {}
    vec(float a, float b, float c) : x(a), y(b), z(c) {}
    vec(float *v) : x(v[0]), y(v[1]), z(v[2]) {}

    float &operator[](int i)       { return v[i]; }
    float  operator[](int i) const { return v[i]; }

    bool iszero() const { return x==0 && y==0 && z==0; }

    bool operator==(const vec &o) const { return x == o.x && y == o.y && z == o.z; }
    bool operator!=(const vec &o) const { return x != o.x || y != o.y || z != o.z; }
    vec operator-() const { return vec(-x, -y, -z); }

    vec &mul(float f) { x *= f; y *= f; z *= f; return *this; }
    vec &div(float f) { x /= f; y /= f; z /= f; return *this; }
    vec &add(float f) { x += f; y += f; z += f; return *this; }
    vec &sub(float f) { x -= f; y -= f; z -= f; return *this; }

    vec &add(const vec &o) { x += o.x; y += o.y; z += o.z; return *this; }
    vec &sub(const vec &o) { x -= o.x; y -= o.y; z -= o.z; return *this; }

    float squaredlen() const { return x*x + y*y + z*z; }
    float dot(const vec &o) const { return x*o.x + y*o.y + z*o.z; }

    float magnitude() const { return sqrtf(squaredlen()); }
    vec &normalize() { div(magnitude()); return *this; }

    float dist(const vec &e) const { vec t; return dist(e, t); }
    float dist(const vec &e, vec &t) const { t = *this; t.sub(e); return t.magnitude(); }

    float distxy(const vec &e) const { float dx = e.x - x, dy = e.y - y; return sqrtf(dx*dx + dy*dy); }
    float magnitudexy() const { return sqrtf(x*x + y*y); }

    bool reject(const vec &o, float max) const { return x>o.x+max || x<o.x-max || y>o.y+max || y<o.y-max; }

    vec &cross(const vec &a, const vec &b) { x = a.y*b.z-a.z*b.y; y = a.z*b.x-a.x*b.z; z = a.x*b.y-a.y*b.x; return *this; }

    void rotate_around_z(float angle) { *this = vec(cosf(angle)*x-sinf(angle)*y, cosf(angle)*y+sinf(angle)*x, z); }
    void rotate_around_x(float angle) { *this = vec(x, cosf(angle)*y-sinf(angle)*z, cosf(angle)*z+sinf(angle)*y); }
    void rotate_around_y(float angle) { *this = vec(cosf(angle)*x-sinf(angle)*z, y, cosf(angle)*z+sinf(angle)*x); }

    vec &rotate(float angle, const vec &d)
    {
        float c = cosf(angle), s = sinf(angle);
        return rotate(c, s, d);
    }

    vec &rotate(float c, float s, const vec &d)
    {
        *this = vec(x*(d.x*d.x*(1-c)+c) + y*(d.x*d.y*(1-c)-d.z*s) + z*(d.x*d.z*(1-c)+d.y*s),
                    x*(d.y*d.x*(1-c)+d.z*s) + y*(d.y*d.y*(1-c)+c) + z*(d.y*d.z*(1-c)-d.x*s),
                    x*(d.x*d.z*(1-c)-d.y*s) + y*(d.y*d.z*(1-c)+d.x*s) + z*(d.z*d.z*(1-c)+c));
        return *this;
    }

    void orthogonal(const vec &d)
    {
        int i = fabs(d.x) > fabs(d.y) ? (fabs(d.x) > fabs(d.z) ? 0 : 2) : (fabs(d.y) > fabs(d.z) ? 1 : 2);
        v[i] = d[(i+1)%3];
        v[(i+1)%3] = -d[i];
        v[(i+2)%3] = 0;
    }
};

class cPlayer
{
public:
		char unknown0[4]; //0x0000
	vec pos;
		char unknown16[36]; //0x0010
	vec footpos;
	float yaw; //0x0040  
	float pitch; //0x0044  
};//Size=0x0228(552)


class cPlayerTable
{
public:
	char unknown0[4]; //0x0000
	cPlayer* player[32]; //0x0004  
};//Size=0x043C(1084)
We access our player data with this c++ code:
Code:
cPlayer* player = *(cPlayer**)(0x4E4DBC);
//to access things:
player->pitch = 90;
player->yaw = 90;
Im not gonna explain the syntax or anything, i suggest you experiment yourself to find out.
and for the other players:
Code:
cPlayerTable* pPlayerTable = *(cPlayerTable**)(0x4E4DBC);
//to access other player's XYZ
pPlayerTable->player[0]->pos; //0-31 is valid
[end of part 2]

ALL you need now is the math and the value of the # of players in the game (4E4E10).
I got 4E4E10 by looking at the cmp's, and it would compare the index of the array to 4E4E10 and jmp if it was above/below basically.
Now you can figure out ta mathz
I make for ALL PB
Real Combat Arms aimbot.
This is the reason CA pubs have aimbots now

Credits Gellin

Code:
#include "aimbot.h"

cAimbot*   aimbot	= NULL;

CTimer ctGetNextPos[26];

int cAimbot::GetNearestPlayer( int VisCheck, int AimBone, int AimAtTeam, int SpawnCheck, int Fov )
{
	int iAimAt = -1;
	float fNearest = (float)INT_MAX;

	for( int i = 0; i <= 24; i++ )
	{
		if( esp->bValidObject( i ) && !esp->Players[i].bIsDead )
		{
			if( AimAtTeam == 0 && esp->Players[i].Charector->TeamID == esp->local.iTeam )
				continue;

			if( VisCheck == 1 && !esp->Players[i].bVisible )
				continue;

			if( Fov == 0 && !esp->Players[i].bOnScreen )
				continue;

			if( SpawnCheck == 1 && esp->Players[i].bSpawnShield )
				continue;

			if( esp->Players[i].fDistance < fNearest )
			{
				iAimAt = i;
				fNearest = esp->Players[i].fDistance;
			}
		}
	}
	return iAimAt;
}

int cAimbot::GetNearestToCrosshair( int VisCheck, int AimBone, int AimAtTeam, int SpawnCheck )
{
	int iAimAt = -1;
	double fNearest = (float)INT_MAX;

	for( int i = 0; i <= 24; i++ )
	{
		if( esp->bValidObject( i ) && esp->bValidCords( i ) && !esp->Players[i].bIsDead )
		{
			if( !esp->Players[i].bOnScreen )
				continue;

			if( AimAtTeam == 0 && esp->Players[i].Charector->TeamID == esp->local.iTeam )
				continue;

			if( VisCheck == 1 && !esp->Players[i].bVisible )
				continue;

			if( SpawnCheck == 1 && esp->Players[i].bSpawnShield )
				continue;

			D3DXVECTOR3 Screen( (float)main->ScreenW2, (float)main->ScreenH2, 0.0f );
			D3DXVECTOR3 Pos = ( esp->Players[i].HeadScreen - Screen );

			double Dist = ( ( Pos.x * Pos.x ) + ( Pos.y * Pos.y ) + ( Pos.z * Pos.z ) );

			if( Dist < fNearest )
			{
				fNearest = Dist;
				iAimAt = i;
			}
		}
	}
	return iAimAt;
}

void cAimbot::Lock( int AimType, int AimBone, int AutoAim, int AutoFire, int VisCheck, int AimAtTeam, int SpawnCheck, int AutoSwitch, int Prediction )
{
	if( !esp->local.bDead )
	{ 
		if( AutoAim || GetAsyncKeyState( menu->iAimKey ) < 0 )
		{
			if( NearestEnemy == -1 && Ready )
			{
				if( AimType == 1 )
					NearestEnemy = GetNearestPlayer( VisCheck, AimBone, AimAtTeam, SpawnCheck, menu->MaxFov );
				else if( AimType == 2 )
					NearestEnemy = GetNearestToCrosshair( VisCheck, AimBone, AimAtTeam, SpawnCheck );
			}

			if( NearestEnemy != -1 && Ready )
			{		
				if( esp->bValidObject( NearestEnemy ) && !esp->Players[NearestEnemy].bIsDead )
				{
					D3DXVECTOR3 Angles, FinalAimSpot;

					if( Prediction == 1 )
						FinalAimSpot = GhettoPrediction( NearestEnemy, 55, esp->Players[NearestEnemy].AimTransform.Pos, ctGetNextPos );
					else
						FinalAimSpot = esp->Players[NearestEnemy].AimTransform.Pos;

					if( VisCheck == 1 && !esp->Players[NearestEnemy].bVisible )
					{
						NearestEnemy = -1;
						Ready = true;
						return;
					}

					GetAngleToTarget( FinalAimSpot, esp->local.CameraPos, Angles );

					engine->GetPlayerMgr()->Yaw   = DegToRad ( Angles[YAW] );
					engine->GetPlayerMgr()->Pitch = DegToRad ( Angles[PITCH] );

					if( AutoFire )
					{			
						mouse_event( MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 );
						mouse_event( MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 );
					}

					if( AimType == 1 )
					{
						Ready = true;
						NearestEnemy = -1;
					}
				}
				else
				{
					if( AutoSwitch || AutoAim )
					{
						Ready = true;	
						NearestEnemy = -1;
					}
					else
					{
						Ready = false;
						NearestEnemy = -1;
					}
				}
			}
		}
		else
		{
			Ready = true;
			NearestEnemy = -1;
		}
	}
}


void cAimbot::NPC_Lock( int AimType, int AimBone, int AutoAim, int AutoFire, int VisCheck, int AutoSwitch, int Prediction )
{
	if( !esp->local.bDead && AutoAim || GetAsyncKeyState( menu->iAimKey ) < 0 )
	{
		if( engine->ValidGamePointers() )
		{
			if( BestNPC == -1 && Ready )
			{
				if( AimType == 1 )
					BestNPC = GetNearestNPC( VisCheck, AimBone, menu->MaxFov );
				else if( AimType == 2 )
					BestNPC = GetNearestNPCToCrosshair( VisCheck, AimBone );
			}

			if( BestNPC != -1 && Ready )
			{
				D3DXVECTOR3 Angles, FinalAimSpot;

				cCharacterFX* Character = (cCharacterFX*)engine->GetGameClientShell()->GetSFXMgr()->SFXList[SFX_CHARACTER].List[BestNPC];

				if( engine->ValidPointer( Character ) && engine->ValidPointer( Character->Object ) )
				{
					Transform HeadTransform;
					unsigned int AimSpot;

					switch( AimBone )
					{
						case 1:
							AimSpot = engine->GetLTModel()->GetNodeTransform( Character->Object, 8, &HeadTransform,  true );
							HeadTransform.Pos.y += 5.8f;
							break;

						case 2:
							AimSpot = engine->GetLTModel()->GetNodeTransform( Character->Object, 6, &HeadTransform,  true );
							break;

						case 3:
							AimSpot = engine->GetLTModel()->GetNodeTransform( Character->Object, 7, &HeadTransform,  true );
							break;

						case 4:
							AimSpot = engine->GetLTModel()->GetNodeTransform( Character->Object, 4, &HeadTransform,  true );
							HeadTransform.Pos.y -= 6.0f;
							break;
					}

					if( VisCheck == 1 && engine->IsVisible( HeadTransform.Pos ) == false )
					{
						BestNPC = -1;
						Ready = true;
						return;
					}

					GetAngleToTarget( HeadTransform.Pos, esp->local.CameraPos, Angles );

					engine->GetPlayerMgr()->Yaw   = DegToRad ( Angles[YAW] );
					engine->GetPlayerMgr()->Pitch = DegToRad ( Angles[PITCH] );

					if( AutoFire )
					{			
						mouse_event( MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 );
						mouse_event( MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 );
					}

					if( AimType == 1 )
					{
						BestNPC = -1;
						Ready = true;
					}
				}
				else 
				{
					if( AutoSwitch || AutoAim  )
					{
						BestNPC = -1;
						Ready = true;
					}
					else
					{
						BestNPC = -1;
						Ready = false;
					}
				}
			}
		}
	}
	else
	{
		BestNPC = -1;
		Ready = true;	
	}
}

int cAimbot::GetNearestNPCToCrosshair( int VisCheck, int AimBone )
{
	if( !engine ) 
		return -1;

	int iAimAt = -1;
	float fNearest = (float)INT_MAX;

	cSFXMgr* SFXMgr = engine->GetGameClientShell()->GetSFXMgr();

	if( engine->ValidPointer( SFXMgr ) ) 
	{
		for(int i = 0; i < SFXMgr->SFXList[SFX_CHARACTER].Num; i++)
		{
			cCharacterFX* NPC = (cCharacterFX*)SFXMgr->SFXList[SFX_CHARACTER].List[i];

			if(engine->ValidPointer( NPC ) && engine->ValidPointer( NPC->Object ) )
			{
				if( esp->local.Object == NPC->Object )	
					continue; 

				int Type = NPC->IsPlayer;

				if( Type != 0 )
					continue;

				Transform HeadTransform;
				unsigned int AimSpot;

				switch( AimBone )
				{
					case 1:
						AimSpot = engine->GetLTModel()->GetNodeTransform  ( NPC->Object, 8, &HeadTransform,  true );
						HeadTransform.Pos.y += 7.0f;
						break;
					case 2:
						AimSpot = engine->GetLTModel()->GetNodeTransform  ( NPC->Object, 6, &HeadTransform,  true );
						break;
					case 3:
						AimSpot = engine->GetLTModel()->GetNodeTransform  ( NPC->Object, 7, &HeadTransform,  true );
						break;
					case 4:
						AimSpot = engine->GetLTModel()->GetNodeTransform  ( NPC->Object, 4, &HeadTransform,  true );
						HeadTransform.Pos.y -= 5.0f;
						break;
				}

				if( VisCheck == 1 && !engine->IsVisible( HeadTransform.Pos ) )
					continue;

				D3DXVECTOR3 Out;

				if( !engine->WorldToScreen( HeadTransform.Pos, &Out ) )
					continue;

				Out.z = 0;

				D3DXVECTOR3 Screen( (float)main->ScreenW2, (float)main->ScreenH2, 0 );
				D3DXVECTOR3 Pos = ( Out - Screen );

				float Dist = sqrt( (Pos.x * Pos.x ) + ( Pos.y * Pos.y ) + ( Pos.z * Pos.z ) );

				if( Dist < fNearest )
				{
					fNearest = Dist;
					iAimAt = i;
				}
			}
		}
	}
	return iAimAt;
}

int cAimbot::GetNearestNPC( int VisCheck, int AimBone, int Fov )
{
	if( !engine )
		return -1;

	int iAimAt = -1;
	float fNearest = (float)INT_MAX;

	cSFXMgr* SFXMgr = engine->GetGameClientShell()->GetSFXMgr();

	if( engine->ValidPointer( SFXMgr ) )
	{
		for( int i = 0; i < SFXMgr->SFXList[SFX_CHARACTER].Num; i++ )
		{
			cCharacterFX* NPC = (cCharacterFX*)SFXMgr->SFXList[SFX_CHARACTER].List[i];

			if( engine->ValidPointer(NPC) && engine->ValidPointer(NPC->Object) )
			{
				int* MyObj = engine->GetLTBase()->GetClientObject();

				if( MyObj && MyObj == NPC->Object )	
					continue; 

				int Type = NPC->IsPlayer;

				if( Type != 0 )
					continue;

				Transform HeadTransform;
				unsigned int AimSpot;

				switch( AimBone )
				{
					case 1:
						AimSpot = engine->GetLTModel()->GetNodeTransform( NPC->Object, 8, &HeadTransform,  true );
						HeadTransform.Pos.y += 7.0f;
						break;
					case 2:
						AimSpot = engine->GetLTModel()->GetNodeTransform( NPC->Object, 6, &HeadTransform,  true );
						break;
					case 3:
						AimSpot = engine->GetLTModel()->GetNodeTransform( NPC->Object, 7, &HeadTransform,  true );
						break;
					case 4:
						AimSpot = engine->GetLTModel()->GetNodeTransform( NPC->Object, 4, &HeadTransform,  true );
						HeadTransform.Pos.y -= main->fNutOff;
						break;
				}

				if( VisCheck == 1 && !engine->IsVisible( HeadTransform.Pos ) )
					continue;

				D3DXVECTOR3 Dummy;

				if( (int)menu->cBox[4].OnOff == 1 && Fov == 0 && !engine->WorldToScreen( HeadTransform.Pos, &Dummy ) )
					continue;

				float v[3];
				VectorSubtract( HeadTransform.Pos, esp->local.CameraPos, v );
				float fTemp = sqrt( v[0]*v[0] + v[1]*v[1] + v[2]*v[2] ) / 48;

				if( fTemp < fNearest )
				{
					iAimAt = i;
					fNearest = fTemp;
				}
			}
		}
	}
	return iAimAt;
}

void cAimbot::AngleVectors( const float* angles, float* forward, float* right, float* up )
{
	float			angle;
	static float	sr, sp, sy, cr, cp, cy, t;

	angle = angles[YAW];
	sy = sin(angle);
	cy = cos(angle);

	angle = angles[PITCH];
	sp = sin(angle);
	cp = cos(angle);

	angle =  angles[ROLL];
	sr = sin(angle);
	cr = cos(angle);

	if( forward )
	{
		forward[0] = cp*cy;
		forward[1] = cp*sy;
		forward[2] = -sp;
	}
	if( right )
	{
		t = sr*sp;
		right[0] = ( -1*t*cy+-1*cr*-sy );
		right[1] = ( -1*t*sy+-1*cr*cy );
		right[2] = -1*sr*cp;
	}
	if( up )
	{
		t = cr*sp;
		up[0] = ( t*cy+-sr*-sy );
		up[1] = ( t*sy+-sr*cy );
		up[2] = cr*cp;
	}
}

void cAimbot::VectorAngles( const float* forward, float* angles )
{
	float tmp, yaw, pitch;

	if( forward[2] == 0 && forward[0] == 0 )
	{
		yaw = 0;

		if( forward[2] > 0 )
			pitch = 90;
		else
			pitch = 270;
	}
	else 
	{
		yaw = ( atan2( forward[2], -forward[0] ) * 180 / M_PI )-90;

		if( yaw < 0 )
			yaw += 360;

		tmp = sqrt( forward[0] * forward[0] + forward[2] * forward[2] );
		pitch = ( atan2( forward[1], tmp) * 180 / M_PI );

		if( pitch < 0 )
			pitch += 360;
	}

	angles[0] = -pitch;
	angles[1] = yaw;
	angles[2] = 0;
}


void cAimbot::GetAngleToTarget(D3DXVECTOR3 vTargetPos, D3DXVECTOR3 vCameraPos, D3DXVECTOR3& vAngles)
{
	D3DXVECTOR3 vDelta;
	vDelta.x = vTargetPos.x - vCameraPos.x;
	vDelta.y = vTargetPos.y - vCameraPos.y;
	vDelta.z = vTargetPos.z - vCameraPos.z;

	VectorAngles( (float*)&vDelta, (float*)&vAngles );

	if( vAngles.x > 180.0f )          
		vAngles.x  -= 360.0f; 
	else if( vAngles.x < -180.0f )    
		vAngles.x   += 360.0f; 

	if( vAngles.y > 180.0f )            
		vAngles.y     -= 360.0f; 
	else if( vAngles.y < -180.0f )      
		vAngles.y    += 360.0f; 
}


float cAimbot::GetAngleDistanceFromYaw( float fYaw, D3DXVECTOR3 vPos, D3DXVECTOR3 vTarget )
{
	D3DXVECTOR2 vDist( vPos.x - vTarget.x, vPos.z - vTarget.z );
	
	float fHypot	= VectToHypot( vDist ) + 0.000001f;
	float fView		= acos( ( vDist.y + 0.000001f ) / fHypot );
	
	if( vDist.x < 0 && vDist.y < 0 || vDist.x < 0 && vDist.y > 0 )
		fView	= ( M_PI - fView );
	else
		fView	= ( M_PI + fView );
	
	return fabsf( fYaw - fView );
}

D3DXVECTOR3 cAimbot::GhettoPrediction( int i, int iWait, D3DXVECTOR3 Pos, CTimer* TimerList )
{
	if( !TimerList[i]****nning() )
	{
		this->oldPos = Pos;
		TimerList[i].Start( iWait );
	}

	if( Pos.x > this->oldPos.x )
	{
		this->diffPos.x = Pos.x - this->oldPos.x;
		Pos.x += this->diffPos.x;
	}
	else //if( Pos.x < this->oldPos.x )
	{
		this->diffPos.x = this->oldPos.x - Pos.x;
		Pos.x -= this->diffPos.x;
	}

	if( Pos.y > this->oldPos.y )
	{
		this->diffPos.y = Pos.y - this->oldPos.y;
		Pos.y += this->diffPos.y;
	}
	else //if( Pos.y < this->oldPos.y )
	{
		this->diffPos.y = this->oldPos.y - Pos.y;
		Pos.y -= this->diffPos.y;
	}

	if( Pos.z > this->oldPos.z )
	{
		this->diffPos.z = Pos.z - this->oldPos.z;
		Pos.z += this->diffPos.z;
	}
	else //if( Pos.z < this->oldPos.z )
	{
		this->diffPos.z = this->oldPos.z - Pos.z;
		Pos.z -= this->diffPos.z;
	}
	return Pos;
}
thank you very much for putting this thread together it will help me alot. much appreciated, many thanks
Posts 46–51 of 51 · Page 4 of 4
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us