Page MenuHomeFeedback Tracker

Function AnglesToVector() does not work correctly?
New, UrgentPublic

Description

I need to get the coordinates of the point at an angle and at a distance from the player / object depending on orientation (angles)

If i use function AnglesToVector() with orientation as argument
I get the direction, but when combined with the position, I get only the coordinates on the plane

may be i must to use another functions?

how to get correct results?

Details

Severity
None
Resolution
Open
Reproducibility
N/A
Operating System
Windows 7 x64
Operating System Version
Windows Server 2008 R2
Category
General
Steps To Reproduce
//get point coords at dist 2m, at angle 45deg UP of right side of player
float dist = 2;
vector orientation = player.GetOrientation(); //player orientation in world //for example orientation[0] = 20, orientation[1] = 0; orientation[2] = 45;
orientation[0] = orientation[0] + 90; //right side
vector new_dir = orientation.AnglesToVector() * dist; // \brief Converts spherical coordinates (yaw, pitch, roll in degrees) to unit length vector \return \p normalized direction vector

vector POS = player.GetPosition() + (new_dir * dist);

//at this point POS always contains coordinates on the plate, without up correction

Event Timeline

borizz.k created this task.Aug 5 2019, 4:50 PM
borizz.k edited Steps To Reproduce. (Show Details)Aug 5 2019, 4:55 PM
borizz.k edited Steps To Reproduce. (Show Details)