Advertisement
dudeinberlin

Untitled

Oct 28th, 2013
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.64 KB | None | 0 0
  1. do all loggings in engine.
  2.  
  3. void cNerdBot::CalculateTrailPoints(fb::Vec3& vEndPoint)
  4. {
  5.     if (GunInfo.flBulletGrav != 7.2f) return;// || GunInfo.flBulletGrav != 8.0f)return;
  6.     __declspec(align(16)) fb::Vec3 vPrevPos;
  7.     __declspec(align(16)) fb::Vec3 vPos;
  8.     fb::RayCastHit ray;
  9.  
  10.     Vec3  forward;
  11.     Vec3  vUp;
  12.     Vec3  vOrigin;
  13.  
  14.     forward.GetAxis( &MyCSW->m_weapon->m_shootSpace,3);
  15.     vUp.GetAxis( &MyCSW->m_weapon->m_shootSpace,2);
  16.     vOrigin.GetAxis( &MyCSW->m_weapon->m_shootSpace,4);
  17.    
  18.     bool hit=false;
  19.     float flTime=0.f;
  20.     vUp.normalize();
  21.     forward.normalize();
  22.     vPrevPos=vOrigin;
  23.     while((flTime<3.f)&&!hit)
  24.     {
  25.         flTime+=flGlobalDeltaTime;
  26.         vPos=vOrigin+(forward*(flTime*GunInfo.Bulletspeed.z))+(vUp*(flTime*GunInfo.Bulletspeed.y));
  27.         vPos.y-=(GunInfo.flBulletGrav*flTime*flTime);
  28.  
  29.         IPhysicsRayCaster* pIRC = m_Me->physics()->m_manager->rayCaster();
  30.         if(pIRC->physicsRayQuery("x", &vPrevPos, &vPos, &ray, 0x4 | 0x10 | 0x20 | 0x80, NULL))
  31.         {
  32.             vEndPoint=ray.m_position;
  33.             //log materials.
  34.             if(ray.m_material)
  35.             {
  36.                 //if(ray.m_material->getType())
  37.                 //  memmove(&(rayname1[0]),ray.m_material->getType()->getName(),50);
  38.                 Raycastmaterialflags[1] = ray.m_material->m_flagsAndIndex;
  39.                
  40.                
  41.             }
  42.             if(ray.m_rigidBody)
  43.             {
  44.                 if(ray.m_rigidBody->getType())
  45.                     memmove(&(rayname1[0]),ray.m_rigidBody->getType()->getName(),50);
  46.                 Raycastmaterialflags[2] = ray.m_rigidBody->m_rayCastTransformCount;
  47.  
  48.             }
  49.             return;
  50.         }
  51.         vPrevPos=vPos;
  52.     }
  53.     vEndPoint=vPos;
  54. }
  55.  
  56. call in engine cuz of raycast
  57.  
  58. CalculateTrailPoints(Grenade_Aimpoint);
  59.  
  60. Grenadeaimpoint is a vec3 that gets filled in trailpoint void
  61.  
  62.  
  63. in draw display this
  64.  
  65.     if(rayname1 !=0)
  66.     {   sprintf(buf,"rayname %s"  ,rayname1  );pDX->DrawGlowText(bSimple,buf,20,dxy+(PositionIndex*15),tGray,tBlue,fontHaet18);PositionIndex+=1;}  
  67. //  if(rayname2)
  68. //  {   sprintf(buf,"rayname %s"  ,rayname2  );pDX->DrawGlowText(bSimple,buf,20,dxy+(PositionIndex*15),tGray,tBlue,fontHaet18);PositionIndex+=1;}  
  69.  
  70. {   sprintf(buf,"Raycastmaterialflags1 %d"  ,Raycastmaterialflags[1]  );pDX->DrawGlowText(bSimple,buf,20,dxy+(PositionIndex*15),tGray,tBlue,fontHaet18);PositionIndex+=1;} 
  71. {   sprintf(buf,"Raycast transform count %d"  ,Raycastmaterialflags[2]  );pDX->DrawGlowText(bSimple,buf,20,dxy+(PositionIndex*15),tGray,tBlue,fontHaet18);PositionIndex+=1;}   
  72.  
  73.  
  74. most important draw this to see where the raycast stops. with this you can acurately log all shit and setup super aimbot
  75.  
  76. if (GunInfo.flBulletGrav == 7.2f && !m_Me->isReloading())
  77.     {
  78.     //  float dist =  vecNerd.Origin.distance(Grenade_Aimpoint);
  79.        
  80.         fb::DebugRenderer2::Singleton()->DrawSphere(Grenade_Aimpoint,0.4f,0x8000FFFF);
  81.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement