Click or drag to resize

Vector2D Structure

Represents 2D vectors and points.

Namespace:  LightBuzz
Assembly:  LightBuzz (in LightBuzz.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[SerializableAttribute]
public struct Vector2D

The Vector2D type exposes the following members.

Constructors
  NameDescription
Public methodVector2D
Constructs a new vector with given X and Y components.
Top
Properties
  NameDescription
Public propertyItem
Access the X, Y components of the vector using [0], [1] respectively.
Public propertyLength
Returns the length of the current vector.
Public propertyLengthSquared
Returns the squared length of the current vector.
Public propertyMagnitude
Returns the length of the current vector.
Public propertyMagnitudeSquared
Returns the squared length of the current vector.
Public propertyNormalized
Returns the current vector with a length of 1.
Top
Methods
  NameDescription
Public methodAdd(Vector2D)
Adds the specified vector to the current one.
Public methodStatic memberAdd(Vector2D, Vector2D)
Adds two vectors.
Public methodAngle(Vector2D)
Returns the angle (in degrees) between the current and the specified vector.
Public methodStatic memberAngle(Vector2D, Vector2D)
Returns the angle (in degrees) between two vectors.
Public methodDistance(Vector2D)
Returns the distance between the current vector and the specified vector.
Public methodStatic memberDistance(Vector2D, Vector2D)
Returns the distance between two vectors.
Public methodDivide(Single)
Divides the current vector by the specified number.
Public methodStatic memberDivide(Vector2D, Single)
Divides a vector by a number.
Public methodStatic memberDot
Returns the dot product of two vectors.
Public methodEquals(Object)
Determines whether the specified object is equal to the current object.
(Overrides ValueTypeEquals(Object).)
Public methodStatic memberEquals(Vector2D, Vector2D)
Specifies whether two vectors are approximately equal.
Public methodGetHashCode
Returns the hash code of the current object.
(Overrides ValueTypeGetHashCode.)
Public methodGetType (Inherited from Object.)
Public methodLerp(Vector2D, Single)
Linearly interpolates between the current and the specified vector by t.
Public methodStatic memberLerp(Vector2D, Vector2D, Single)
Linearly interpolates between two vectors by t.
Public methodStatic memberMax
Returns the vector with the maximum length.
Public methodStatic memberMin
Returns the vector with the minimum length.
Public methodMultiply(Single)
Multiplies the specified vector with the specified number.
Public methodStatic memberMultiply(Single, Vector2D)
Multiplies a vector by a number.
Public methodStatic memberMultiply(Vector2D, Single)
Multiplies a vector by a number.
Public methodNegate
Negates every component of the current vector.
Public methodStatic memberNegate(Vector2D)
Negates every component of the specified vector.
Public methodNormalize
Makes the current vector have a magnitude of 1.
Public methodStatic memberNormalize(Vector2D)
Makes the specified vector have a magnitude of 1.
Public methodSet
Sets the X and Y components of the current vector.
Public methodSubtract(Vector2D)
Subtracts the specified vector from the current one.
Public methodStatic memberSubtract(Vector2D, Vector2D)
Subtracts the second vector from the first vector.
Public methodToString
Returns a string representation of the current object.
(Overrides ValueTypeToString.)
Top
Operators
  NameDescription
Public operatorStatic memberAddition
Adds two vectors.
Public operatorStatic memberDivision
Divides a vector by a number.
Public operatorStatic memberEquality
Compares two vectors for equality.
Public operatorStatic memberGreaterThan
Compares the lengths of two vectors.
Public operatorStatic memberGreaterThanOrEqual
Compares the lengths of two vectors.
Public operatorStatic member(Vector2 to Vector2D)
Converts the specified Unity Vector2 into its equivalent 2D vector.
Public operatorStatic member(Vector3 to Vector2D)
Converts the specified Unity Vector3 into its equivalent 2D vector.
Public operatorStatic member(Vector2D to Vector2)
Converts the specified 2D vector into its equivalent Unity Vector2.
Public operatorStatic member(Vector2D to Vector3)
Converts the specified 2D vector into its equivalent Unity Vector3.
Public operatorStatic member(Vector3D to Vector2D)
Converts the specified 3D vector into its equivalent 2D vector.
Public operatorStatic member(Vector4D to Vector2D)
Converts the specified 4D vector into its equivalent 2D vector.
Public operatorStatic memberInequality
Compares two vectors for inequality.
Public operatorStatic memberLessThan
Compares the lengths of two vectors.
Public operatorStatic memberLessThanOrEqual
Compares the lengths of two vectors.
Public operatorStatic memberMultiply(Single, Vector2D)
Multiplies a number by a vector.
Public operatorStatic memberMultiply(Vector2D, Single)
Multiplies a vector by a number.
Public operatorStatic memberSubtraction
Subtracts one vector from another.
Public operatorStatic memberUnaryNegation
Negates a vector.
Top
Fields
  NameDescription
Public fieldStatic memberDown
Shorthand for (0, -1).
Public fieldStatic memberLeft
Shorthand for (-1, 0).
Public fieldStatic memberNegativeInfinity
Shorthand for (-∞, -∞).
Public fieldStatic memberOne
Shorthand for (1, 1).
Public fieldStatic memberPositiveInfinity
Shorthand for (+∞, +∞).
Public fieldStatic memberRight
Shorthand for (1, 0).
Public fieldStatic memberUp
Shorthand for (0, 1).
Public fieldX
X component of the vector.
Public fieldY
Y component of the vector.
Public fieldStatic memberZero
Shorthand for (0, 0).
Top
Extension Methods
  NameDescription
Public Extension MethodToStringDetailed
Displays the current vector as a detailed string.
(Defined by UnityExtensions.)
Top
See Also