Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- do all loggings in engine.
- void cNerdBot::CalculateTrailPoints(fb::Vec3& vEndPoint)
- {
- if (GunInfo.flBulletGrav != 7.2f) return;// || GunInfo.flBulletGrav != 8.0f)return;
- __declspec(align(16)) fb::Vec3 vPrevPos;
- __declspec(align(16)) fb::Vec3 vPos;
- fb::RayCastHit ray;
- Vec3 forward;
- Vec3 vUp;
- Vec3 vOrigin;
- forward.GetAxis( &MyCSW->m_weapon->m_shootSpace,3);
- vUp.GetAxis( &MyCSW->m_weapon->m_shootSpace,2);
- vOrigin.GetAxis( &MyCSW->m_weapon->m_shootSpace,4);
- bool hit=false;
- float flTime=0.f;
- vUp.normalize();
- forward.normalize();
- vPrevPos=vOrigin;
- while((flTime<3.f)&&!hit)
- {
- flTime+=flGlobalDeltaTime;
- vPos=vOrigin+(forward*(flTime*GunInfo.Bulletspeed.z))+(vUp*(flTime*GunInfo.Bulletspeed.y));
- vPos.y-=(GunInfo.flBulletGrav*flTime*flTime);
- IPhysicsRayCaster* pIRC = m_Me->physics()->m_manager->rayCaster();
- if(pIRC->physicsRayQuery("x", &vPrevPos, &vPos, &ray, 0x4 | 0x10 | 0x20 | 0x80, NULL))
- {
- vEndPoint=ray.m_position;
- //log materials.
- if(ray.m_material)
- {
- //if(ray.m_material->getType())
- // memmove(&(rayname1[0]),ray.m_material->getType()->getName(),50);
- Raycastmaterialflags[1] = ray.m_material->m_flagsAndIndex;
- }
- if(ray.m_rigidBody)
- {
- if(ray.m_rigidBody->getType())
- memmove(&(rayname1[0]),ray.m_rigidBody->getType()->getName(),50);
- Raycastmaterialflags[2] = ray.m_rigidBody->m_rayCastTransformCount;
- }
- return;
- }
- vPrevPos=vPos;
- }
- vEndPoint=vPos;
- }
- call in engine cuz of raycast
- CalculateTrailPoints(Grenade_Aimpoint);
- Grenadeaimpoint is a vec3 that gets filled in trailpoint void
- in draw display this
- if(rayname1 !=0)
- { sprintf(buf,"rayname %s" ,rayname1 );pDX->DrawGlowText(bSimple,buf,20,dxy+(PositionIndex*15),tGray,tBlue,fontHaet18);PositionIndex+=1;}
- // if(rayname2)
- // { sprintf(buf,"rayname %s" ,rayname2 );pDX->DrawGlowText(bSimple,buf,20,dxy+(PositionIndex*15),tGray,tBlue,fontHaet18);PositionIndex+=1;}
- { sprintf(buf,"Raycastmaterialflags1 %d" ,Raycastmaterialflags[1] );pDX->DrawGlowText(bSimple,buf,20,dxy+(PositionIndex*15),tGray,tBlue,fontHaet18);PositionIndex+=1;}
- { sprintf(buf,"Raycast transform count %d" ,Raycastmaterialflags[2] );pDX->DrawGlowText(bSimple,buf,20,dxy+(PositionIndex*15),tGray,tBlue,fontHaet18);PositionIndex+=1;}
- most important draw this to see where the raycast stops. with this you can acurately log all shit and setup super aimbot
- if (GunInfo.flBulletGrav == 7.2f && !m_Me->isReloading())
- {
- // float dist = vecNerd.Origin.distance(Grenade_Aimpoint);
- fb::DebugRenderer2::Singleton()->DrawSphere(Grenade_Aimpoint,0.4f,0x8000FFFF);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement