Vector2D Structure |
Namespace: LightBuzz
The Vector2D type exposes the following members.
| Name | Description | |
|---|---|---|
| Item |
Access the X, Y components of the vector using [0], [1] respectively.
| |
| Length |
Returns the length of the current vector.
| |
| LengthSquared |
Returns the squared length of the current vector.
| |
| Magnitude |
Returns the length of the current vector.
| |
| MagnitudeSquared |
Returns the squared length of the current vector.
| |
| Normalized |
Returns the current vector with a length of 1.
|
| Name | Description | |
|---|---|---|
| Add(Vector2D) |
Adds the specified vector to the current one.
| |
| Add(Vector2D, Vector2D) |
Adds two vectors.
| |
| Angle(Vector2D) |
Returns the angle (in degrees) between the current and the specified vector.
| |
| Angle(Vector2D, Vector2D) |
Returns the angle (in degrees) between two vectors.
| |
| Distance(Vector2D) |
Returns the distance between the current vector and the specified vector.
| |
| Distance(Vector2D, Vector2D) |
Returns the distance between two vectors.
| |
| Divide(Single) |
Divides the current vector by the specified number.
| |
| Divide(Vector2D, Single) |
Divides a vector by a number.
| |
| Dot |
Returns the dot product of two vectors.
| |
| Equals(Object) |
Determines whether the specified object is equal to the current object.
(Overrides ValueTypeEquals(Object).) | |
| Equals(Vector2D, Vector2D) |
Specifies whether two vectors are approximately equal.
| |
| GetHashCode |
Returns the hash code of the current object.
(Overrides ValueTypeGetHashCode.) | |
| GetType | (Inherited from Object.) | |
| Lerp(Vector2D, Single) |
Linearly interpolates between the current and the specified vector by t.
| |
| Lerp(Vector2D, Vector2D, Single) |
Linearly interpolates between two vectors by t.
| |
| Max |
Returns the vector with the maximum length.
| |
| Min |
Returns the vector with the minimum length.
| |
| Multiply(Single) |
Multiplies the specified vector with the specified number.
| |
| Multiply(Single, Vector2D) |
Multiplies a vector by a number.
| |
| Multiply(Vector2D, Single) |
Multiplies a vector by a number.
| |
| Negate |
Negates every component of the current vector.
| |
| Negate(Vector2D) |
Negates every component of the specified vector.
| |
| Normalize |
Makes the current vector have a magnitude of 1.
| |
| Normalize(Vector2D) |
Makes the specified vector have a magnitude of 1.
| |
| Set |
Sets the X and Y components of the current vector.
| |
| Subtract(Vector2D) |
Subtracts the specified vector from the current one.
| |
| Subtract(Vector2D, Vector2D) |
Subtracts the second vector from the first vector.
| |
| ToString |
Returns a string representation of the current object.
(Overrides ValueTypeToString.) |
| Name | Description | |
|---|---|---|
| Addition |
Adds two vectors.
| |
| Division |
Divides a vector by a number.
| |
| Equality |
Compares two vectors for equality.
| |
| GreaterThan |
Compares the lengths of two vectors.
| |
| GreaterThanOrEqual |
Compares the lengths of two vectors.
| |
| (Vector2 to Vector2D) |
Converts the specified Unity Vector2 into its equivalent 2D vector.
| |
| (Vector3 to Vector2D) |
Converts the specified Unity Vector3 into its equivalent 2D vector.
| |
| (Vector2D to Vector2) |
Converts the specified 2D vector into its equivalent Unity Vector2.
| |
| (Vector2D to Vector3) |
Converts the specified 2D vector into its equivalent Unity Vector3.
| |
| (Vector3D to Vector2D) |
Converts the specified 3D vector into its equivalent 2D vector.
| |
| (Vector4D to Vector2D) |
Converts the specified 4D vector into its equivalent 2D vector.
| |
| Inequality |
Compares two vectors for inequality.
| |
| LessThan |
Compares the lengths of two vectors.
| |
| LessThanOrEqual |
Compares the lengths of two vectors.
| |
| Multiply(Single, Vector2D) |
Multiplies a number by a vector.
| |
| Multiply(Vector2D, Single) |
Multiplies a vector by a number.
| |
| Subtraction |
Subtracts one vector from another.
| |
| UnaryNegation |
Negates a vector.
|
| Name | Description | |
|---|---|---|
| Down |
Shorthand for (0, -1).
| |
| Left |
Shorthand for (-1, 0).
| |
| NegativeInfinity |
Shorthand for (-∞, -∞).
| |
| One |
Shorthand for (1, 1).
| |
| PositiveInfinity |
Shorthand for (+∞, +∞).
| |
| Right |
Shorthand for (1, 0).
| |
| Up |
Shorthand for (0, 1).
| |
| X |
X component of the vector.
| |
| Y |
Y component of the vector.
| |
| Zero |
Shorthand for (0, 0).
|
| Name | Description | |
|---|---|---|
| ToStringDetailed |
Displays the current vector as a detailed string.
(Defined by UnityExtensions.) |