Vector3

From GTA Network Wiki
Jump to: navigation, search


Vector3
Server-Side Function

utilities-terminal.png Server-Side csharp.png C#

A vector containing 3 values.

Properties

float X;
float Y;
float Z;
Vector3 Normalized;

Methods

Vector3(); //Initializes to (0, 0, 0) by default
Vector3(float x, float y, float z);
Vector3(double x, double y, double z);

float Length();
float LengthSquared();

float DistanceTo(Vector3 right);
float DistanceToSquared(Vector3 right);

float DistanceTo2D(Vector3 right);
float DistanceTo2DSquared(Vector3 right);

void Normalize();

Vector3 Add(Vector3 right);
Vector3 Subtract(Vector3 right);
Vector3 Multiply(Vector3 right);
Vector3 Divide(Vector3 right);

// Returns a random vector around this vector within the given distance.
Vector3 Around(float distance);

Static Methods

Vector3.Distance(Vector3 right, Vector3 left);
Vector3.DistanceSquared(Vector3 right, Vector3 left);
Vector3 Lerp(Vector3 start, Vector3 end, float n);
Vector3 RandomXY();