Class "Vector"
Constructors
Vector () {: aria-label='Constructors' }
void Vector ( float , float ) {: .copyable aria-label='Constructors' }
Functions
__add () {: aria-label='Functions' }
Addition operators
__div () {: aria-label='Functions' }
Vector __div ( float Modifier ) {: .copyable aria-label='Functions' }
Division operators
__mul () {: aria-label='Functions' }
Vector __mul ( float Modifier ) {: .copyable aria-label='Functions' }
Multiplication operators
__sub () {: aria-label='Functions' }
Subtraction operators
__unm () {: aria-label='Functions' }
Subtraction operators
Clamp () {: aria-label='Functions' }
void Clamp ( float MinX, float MinY, float MaxX, float MaxY ) {: .copyable aria-label='Functions' }
Clamps the vector based on left, top, right, bottom boundings. Doesn't keep direction
Clamped () {: aria-label='Functions' }
Vector Clamped ( float MinX, float MinY, float MaxX, float MaxY ) {: .copyable aria-label='Functions' }
Returns a clamped version of the vector.
Cross () {: aria-label='Functions' }
float Cross ( Vector second ) {: .copyable aria-label='Functions' }
Cross product this is the 2x2 matrix determinant or the resulting z value for their 3D versions with z=0
Distance () {: aria-label='Functions' }
Returns distance between two vectors
???- example "Example Code"
DistanceSquared () {: aria-label='Functions' }
Returns squared distance between two vectors
???- example "Example Code"
Dot () {: aria-label='Functions' }
float Dot ( Vector second ) {: .copyable aria-label='Functions' }
Dot product
FromAngle () {: aria-label='Functions' }
{: .static .tooltip .badge } {: .abp .tooltip .badge }
static Vector FromAngle ( float AngleDegrees ) {: .copyable aria-label='Functions' }
Build a Vector from an angle, returns a normalized vector. Angle 0 will result in (1, 0). Angle 90 will result in (0, 1).
???- example "Example Code" This code returns a vector that has a 45 degree angle
GetAngleDegrees () {: aria-label='Functions' }
float GetAngleDegrees ( ) {: .copyable aria-label='Functions' }
Returns the angle the vector is facing. The vector (1, 0) will be at 0 degrees. The vector (0, 1) will be at 90 degrees.
???- example "Example Code" This code returns the angle between two positions.
Length () {: aria-label='Functions' }
float Length ( ) {: .copyable aria-label='Functions' }
Returns the length of the vector
LengthSquared () {: aria-label='Functions' }
float LengthSquared ( ) {: .copyable aria-label='Functions' }
Returns the length squared of the vector
Lerp () {: aria-label='Functions' }
Linear interpolation between two vectors. For t = 0 it returns the first Vector, for t = 1 it returns the second.
???- example "Alternate Function example" This function does the same as Lerp, but will not alter the input vectors.
???- example "Example Code" This code will make v1 the vector 50% in between v1 and v2
Normalize () {: aria-label='Functions' }
void Normalize ( ) {: .copyable aria-label='Functions' }
Normalizes this vector
Normalized () {: aria-label='Functions' }
Vector Normalized ( ) {: .copyable aria-label='Functions' }
Returns a normalized version of this vector
Resize () {: aria-label='Functions' }
void Resize ( float NewLength ) {: .copyable aria-label='Functions' }
Resizes the vector length.
Resized () {: aria-label='Functions' }
Vector Resized ( float NewLength ) {: .copyable aria-label='Functions' }
Returns a resized version of the vector.
Rotated () {: aria-label='Functions' }
Vector Rotated ( float AngleDegrees ) {: .copyable aria-label='Functions' }
Returns a rotated version of the vector by AngleDegrees
Variables
X {: aria-label='Variables' }
float X {: .copyable aria-label='Variables' }
Components of vector.
Y {: aria-label='Variables' }
float Y {: .copyable aria-label='Variables' }
Last updated