This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
functions:vectortoangles [2019/04/20 23:55] – removed korshun | functions:vectortoangles [2019/04/20 23:56] (current) – created korshun | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== VectorToAngles ====== | ||
+ | {{tag> | ||
+ | '' | ||
+ | [[: | ||
+ | |||
+ | [[: | ||
+ | |||
+ | ===== Description ===== | ||
+ | Converts a 3D vector to a pair of angles (yaw and pitch). | ||
+ | |||
+ | ===== Examples ===== | ||
+ | Make the player look along the vector: | ||
+ | < | ||
+ | VectorToAngles(1.0, | ||
+ | int angle = r1; | ||
+ | int pitch = r2; | ||
+ | |||
+ | SetActorAngle(tid, | ||
+ | SetActorPitch(tid, | ||
+ | </ | ||
+ | |||
+ | <note tip>Use [[LookAtPoint]] instead of the example code above.</ |