User Tools

Site Tools


en:examples:maths:angle_degrees_to_vector

Convert an angle in degrees to a directional vector

orxFLOAT degRotation = 45;			
orxFLOAT radRotation = degRotation * orxMATH_KF_DEG_TO_RAD;
 
orxFLOAT x = orxMath_Cos(radRotation);
orxFLOAT y = orxMath_Sin(radRotation);
 
orxVECTOR directionVector = {x, y, 0};

en/examples/maths/angle_degrees_to_vector.txt · Last modified: 2018/02/14 00:47 (6 years ago) by 127.0.0.1