Gametype Scripting

From Warfork
Revision as of 20:31, 29 March 2020 by Scoot (talk | contribs) (Create Gametype Scripting page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Page in progress.

Types

Vec3

Constructor Description
Vec3() Initializes x,y,z to zero.
Vec3(float v) Initializes x,y,z to v.
Vec3(float x, float y, float z) Initializes x,y,z with the given values for each.
Vec3(Vec3 &in) Copy constructor. Initializes x,y,z to the values on the supplied Vec3.
Property Description
float x The x component of the vector.
float y The y component of the vector.
float z The z component of the vector.
Method Description
void set(float x, float y, float z) Sets the x,y,z components on the vector to the supplied values.
float length() Returns the magnitude of the vector.
float normalize() Normalizes the vector and returns the magnitude pre-normalization.
float distance(Vec3 &in) Returns the distance between the tips of this vector and the supplied vector.
void angleVectors(Vec3 &out, Vec3 &out, Vec3 &out) Constructs three new vectors representing the rotations about the forward, right, and up axes (?)
Vec3 toAngles() Returns a vector representing the current vector as a rotation.
Vec3 perpendicular() Returns the vector perpendicular to this vector.
void makeNormalVectors(Vec3 &out, Vec3 &out) Returns the normal and binormal vector of the current vector (assumed to be the tangent).

The mathematical operators are overloaded for vectors and perform the equivalent vector operation.