Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Vector3 GetCoordsInfrontOfCam(float range)
- {
- Vector3 GameplayCamRot = CAM::GET_GAMEPLAY_CAM_ROT(2);
- Vector3 GameplayCamCoord = CAM::GET_GAMEPLAY_CAM_COORD();
- float tan = (float)(cos(GameplayCamRot.x) * range);
- float xPlane = (float)((sin(GameplayCamRot.z * -1.0f) * tan) + GameplayCamCoord.x);
- float yPlane = (float)((cos(GameplayCamRot.z * -1.0f) * tan) + GameplayCamCoord.y);
- float zPlane = (float)((sin(GameplayCamRot.x) * range) + GameplayCamCoord.z);
- return Vector3{ xPlane, yPlane, zPlane };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement