Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Vector3 GET_COORDS_INFRONT(float d)
- {
- Vector3 ro = CAM::GET_GAMEPLAY_CAM_ROT(2, 0);
- Vector3 rot;
- float x = ro.z + 90;
- while (x < 0) x = x + 360;
- while (x > 360)
- {
- x = x - 360;
- }
- bool fix = false;
- if (x > 180)
- {
- fix = true;
- }
- rot.x = x;
- rot.z = ro.x;
- float cosrotz = NewMath::Cos(rot.z);
- Vector3 _coords;
- _coords.x = 0.f;
- _coords.y = 0.f;
- _coords.z = d * NewMath::Sin(rot.z);
- if (fix == true)
- {
- rot.x = (rot.x - 180);
- _coords.x = -d * NewMath::Cos(rot.x)*cosrotz;
- _coords.y = -d * NewMath::Sin(rot.x)*cosrotz;
- }
- else
- {
- _coords.x = d * NewMath::Cos(rot.x)*cosrotz;
- _coords.y = d * NewMath::Sin(rot.x)*cosrotz;
- }
- Vector3 ForwardCoords(_coords.x, _coords.y, _coords.z);
- return ForwardCoords;
- }
Advertisement
Add Comment
Please, Sign In to add comment