ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


math

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
math [2019/04/22 00:31]
korshun [logb]
math [2019/07/05 22:38] (current)
korshun [VectorToAngles]
Line 292: Line 292:
 Converts the vector'​s direction to a pair of angles (angle, pitch) and returns them using [[multiple return values]]. Converts the vector'​s direction to a pair of angles (angle, pitch) and returns them using [[multiple return values]].
  
-<note important>​Remember that ZDoom uses inverted ​pitch angles on actors. ACSUtils functions don'​t ​invert ​pitches.</​note>​+<note important>​Remember that ZDoom uses negated ​pitch angles on actors. ACSUtils functions don'​t ​use negated ​pitches. </​note>​
  
 === Example usage === === Example usage ===
Line 305: Line 305:
     int pitch = r2;     int pitch = r2;
     SetActorAngle(tid,​ angle);     SetActorAngle(tid,​ angle);
-    SetActorPitch(tid,​ -pitch); // SetActorPitch expects ​inverted ​pitch.+    SetActorPitch(tid,​ -pitch); // SetActorPitch expects ​negated ​pitch.
 } }
 </​code>​ </​code>​
Line 314: Line 314:
 Converts a pair of angles (angle, pitch) to a 3D vector of length ''​1.0'',​ which points in the same direction, and returns it using [[multiple return values]]. Converts a pair of angles (angle, pitch) to a 3D vector of length ''​1.0'',​ which points in the same direction, and returns it using [[multiple return values]].
  
-<note important>​Remember that ZDoom uses inverted pitches ​on actors. ACSUtils functions don'​t ​invert ​pitches.</​note>​+<note important>​Remember that ZDoom uses negated pitch angles ​on actors. ACSUtils functions don'​t ​use negated ​pitches.</​note>​ 
 + 
 +=== Example usage === 
 + 
 +<​code>​ 
 +AnglesToVector(GetActorAngle(0),​ -GetActorPitch(0));​ // Un-negate actor pitch 
 +int dirX = r1; 
 +int dirY = r2; 
 +int dirZ = r3; 
 +</​code>​ 
 + 
 ===== Logarithms ===== ===== Logarithms =====
  
math.1555882269.txt.gz · Last modified: 2019/04/22 00:31 by korshun