Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float WarbandAimbot::pointToAimAt(int distance, rgl::vector4 viewingAngles, rgl::vector4 startingPosition, float velocity) {
- rgl::vector4 path[500];
- path[0] = startingPosition;
- for (int i = 1; i < 500; ++i) {
- rgl::vector4 viewingAnglesVelocity = viewingAngles * velocity;
- viewingAnglesVelocity.z -= gravity; // apply gravity
- startingPosition = startingPosition + viewingAnglesVelocity * tickTimer; // kinematics equastion
- path[i] = startingPosition;
- float viewingAnglesVelocityLength = viewingAnglesVelocity.length();
- viewingAnglesVelocity.normalize();
- viewingAnglesVelocityLength = viewingAnglesVelocityLength - viewingAnglesVelocityLength * viewingAnglesVelocityLength * arrowFriction * tickTimer;
- if (viewingAnglesVelocityLength > 0.0000099999997) {
- viewingAngles = viewingAnglesVelocity;
- }
- velocity = viewingAnglesVelocityLength;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement