Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. float WarbandAimbot::pointToAimAt(int distance, rgl::vector4 viewingAngles, rgl::vector4 startingPosition, float velocity) {
  2. rgl::vector4 path[500];
  3. path[0] = startingPosition;
  4.  
  5. for (int i = 1; i < 500; ++i) {
  6. rgl::vector4 viewingAnglesVelocity = viewingAngles * velocity;
  7. viewingAnglesVelocity.z -= gravity; // apply gravity
  8. startingPosition = startingPosition + viewingAnglesVelocity * tickTimer; // kinematics equastion
  9. path[i] = startingPosition;
  10.  
  11. float viewingAnglesVelocityLength = viewingAnglesVelocity.length();
  12. viewingAnglesVelocity.normalize();
  13.  
  14. viewingAnglesVelocityLength = viewingAnglesVelocityLength - viewingAnglesVelocityLength * viewingAnglesVelocityLength * arrowFriction * tickTimer;
  15.  
  16. if (viewingAnglesVelocityLength > 0.0000099999997) {
  17. viewingAngles = viewingAnglesVelocity;
  18. }
  19.  
  20. velocity = viewingAnglesVelocityLength;
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement