Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Decouple view-position and shoot-position in the aimbot #46

Open
AshleighAdams opened this issue May 12, 2018 · 0 comments
Open

Decouple view-position and shoot-position in the aimbot #46

AshleighAdams opened this issue May 12, 2018 · 0 comments
Milestone

Comments

@AshleighAdams
Copy link
Collaborator

Currently, view-position and shoot-position are coupled together and calculated by Unit_GetHeadPosition, which is correct for neither. The shoot-position should be where the bullets/projectiles originate, and the view position is where the camera you see through is located.

The shoot direction from the shoot pos is calculated, as far as I can tell, by:

Vector view_pos = ...;
Vector view_dir = ...;

// this may be overridden to an enemy pos if you're looking roughly at them i think
Vector aim_at = TraceFrom(view_pos, view_dir).HitPos;

Vector shoot_pos = ...;
Vector shoot_dir = (aim_at - shoot_pos).Normal();

This is what is responsible for all third-person weapons aiming too high, and, if it remains coupled, will cause a disparity between the calculated projectile impact time and actual projectile impact time. The larger the difference betwen view_pos and shoot_pos, the larger the disparity.

@AshleighAdams AshleighAdams added this to the Projectiles milestone May 12, 2018
@AshleighAdams AshleighAdams reopened this May 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant