RotateVector

native clearscope static Vector2 RotateVector(Vector2 vec, double angle)

Note: This feature is for ZScript only.

Usage

Rotates a 2D vector by the given angle. Used to get a vector to point in a new direction without modifying the magnitude of the vector. This function can only be called by classes inheriting from Actor.

Parameters

  • vec - The 2D vector to rotate
  • angle - How many degrees to rotate the vector by. Negative values rotate it clockwise while positive values rotate it counterclockwise.

Return value

Returns the rotated Vector2.

Examples

Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please add them. This will make it easier to understand for future authors seeking assistance. Your contributions are greatly appreciated.
This article is issued from Zdoom. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.