Struct Vector3
Implements
Inherited Members
Namespace: GTA.Math
Assembly: ScriptHookVDotNet2.dll
Syntax
[Serializable]
public struct Vector3 : IEquatable<Vector3>
Constructors
| Name | Description |
|---|---|
| Vector3(Single, Single, Single) | Initializes a new instance of the Vector3 class. |
Fields
| Name | Description |
|---|---|
| X | Gets or sets the X component of the vector. |
| Y | Gets or sets the Y component of the vector. |
| Z | Gets or sets the Z component of the vector. |
Properties
| Name | Description |
|---|---|
| Item[Int32] | Gets or sets the component at the specified index. |
| Normalized | Returns this vector with a magnitude of 1. |
| RelativeBack | Returns the relative Back vector. (0,-1,0) |
| RelativeBottom | Returns the relative Bottom vector as used. (0,0,-1) |
| RelativeFront | Returns the relative Front vector. (0,1,0) |
| RelativeLeft | Returns the relative Left vector. (-1,0,0) |
| RelativeRight | Returns the relative Right vector. (1,0,0) |
| RelativeTop | Returns the relative Top vector. (0,0,1) |
| WorldDown | Returns the world Down vector. (0,0,-1) |
| WorldEast | Returns the world East vector. (1,0,0) |
| WorldNorth | Returns the world North vector. (0,1,0) |
| WorldSouth | Returns the world South vector. (0,-1,0) |
| WorldUp | Returns the world Up vector. (0,0,1) |
| WorldWest | Returns the world West vector. (-1,0,0) |
| Zero | Returns a null vector. (0,0,0) |
Methods
| Name | Description |
|---|---|
| Add(Vector3, Vector3) | Adds two vectors. |
| Angle(Vector3, Vector3) | Returns the angle in degrees between from and to. The angle returned is always the acute angle between the two vectors. |
| Around(Single) | Creates a random vector inside the circle around this position. |
| Clamp(Vector3, Vector3, Vector3) | Restricts a value to be within a specified range. |
| Cross(Vector3, Vector3) | Calculates the cross product of two vectors. |
| Distance(Vector3, Vector3) | Calculates the distance between two vectors. |
| Distance2D(Vector3, Vector3) | Calculates the distance between two vectors, ignoring the Z-component. |
| DistanceSquared(Vector3, Vector3) | Calculates the squared distance between two vectors. |
| DistanceSquared2D(Vector3, Vector3) | Calculates the squared distance between two vectors, ignoring the Z-component. |
| DistanceTo(Vector3) | Calculates the distance between two vectors. |
| DistanceTo2D(Vector3) | Calculates the distance between two vectors, ignoring the Z-component. |
| DistanceToSquared(Vector3) | Calculates the squared distance between two vectors. |
| DistanceToSquared2D(Vector3) | Calculates the squared distance between two vectors, ignoring the Z-component. |
| Divide(Vector3, Single) | Scales a vector by the given value. |
| Dot(Vector3, Vector3) | Calculates the dot product of two vectors. |
| Equals(Vector3) | Returns a value that indicates whether the current instance is equal to the specified object. |
| Equals(ref Vector3, ref Vector3) | Determines whether the specified object instances are considered equal. |
| Equals(Object) | Returns a value that indicates whether the current instance is equal to a specified object. |
| GetHashCode() | Returns the hash code for this instance. |
| Length() | Calculates the length of the vector. |
| LengthSquared() | Calculates the squared length of the vector. |
| Lerp(Vector3, Vector3, Single) | Performs a linear interpolation between two vectors. |
| Maximize(Vector3, Vector3) | Returns a vector containing the largest components of the specified vectors. |
| Minimize(Vector3, Vector3) | Returns a vector containing the smallest components of the specified vectors. |
| Modulate(Vector3, Vector3) | Modulates a vector by another. |
| Multiply(Vector3, Single) | Scales a vector by the given value. |
| Negate(Vector3) | Reverses the direction of a given vector. |
| Normalize() | Converts the vector into a unit vector. |
| Normalize(Vector3) | Converts the vector into a unit vector. |
| Project(Vector3, Vector3) | Projects a vector onto another vector. |
| ProjectOnPlane(Vector3, Vector3) | Projects a vector onto a plane defined by a normal orthogonal to the plane. |
| RandomXY() | Returns a new normalized vector with random X and Y components. |
| RandomXYZ() | Returns a new normalized vector with random X, Y and Z components. |
| Reflect(Vector3, Vector3) | Returns the reflection of a vector off a surface that has the specified normal. |
| SignedAngle(Vector3, Vector3, Vector3) | Returns the signed angle in degrees between from and to. |
| Subtract(Vector3, Vector3) | Subtracts two vectors. |
| ToHeading() | Converts a vector to a heading. |
| ToString() | Converts the value of the object to its equivalent string representation. |
Operators
| Name | Description |
|---|---|
| Addition(Vector3, Vector3) | Adds two vectors. |
| Division(Vector3, Single) | Scales a vector by the given value. |
| Equality(Vector3, Vector3) | Tests for equality between two objects. |
| Implicit(Vector3 to Vector2) | Converts a Vector3 to a Vector2 implicitly. |
| Inequality(Vector3, Vector3) | Tests for inequality between two objects. |
| Multiply(Vector3, Single) | Scales a vector by the given value. |
| Multiply(Single, Vector3) | Scales a vector by the given value. |
| Subtraction(Vector3, Vector3) | Subtracts two vectors. |
| UnaryNegation(Vector3) | Reverses the direction of a given vector. |