Click or drag to resize

Vector2 Structure

Represents a two-dimensional vector which uses integer values.

Namespace:  Syroot.Maths
Assembly:  Syroot.Maths (in Syroot.Maths.dll) Version: 1.5.3
Syntax
public struct Vector2 : IEquatable<Vector2>, 
	IEquatableByRef<Vector2>

The Vector2 type exposes the following members.

Constructors
  NameDescription
Public methodVector2
Initializes a new instance of the Vector2 structure with the given values for the X and Y components.
Top
Properties
  NameDescription
Public propertyItem
Gets or sets the component at the given index.
Top
Methods
  NameDescription
Public methodEquals(Object)
Gets a value indicating whether the components of this Vector2 are the same as the components of the second specified Vector2.
(Overrides ValueTypeEquals(Object).)
Public methodEquals(Vector2)
Indicates whether the current Vector2 is equal to another Vector2.
Public methodEquals(Vector2)
Indicates whether the current Vector2 is equal to another Vector2. Structures are passed by reference to avoid stack structure copying.
Public methodGetHashCode
Gets a hash code as an indication for object equality.
(Overrides ValueTypeGetHashCode.)
Public methodIntersects
Returns a value indicating whether the Vector2 lies within the provided Rectangle.
Public methodToString
Gets a string describing the components of this Vector2.
(Overrides ValueTypeToString.)
Top
Operators
  NameDescription
Public operatorStatic memberAddition
Adds the first Vector2 to the second one.
Public operatorStatic memberDivision(Vector2, Vector2)
Divides the first Vector2 through the second one.
Public operatorStatic memberDivision(Vector2, Single)
Divides the given Vector2 through the scalar.
Public operatorStatic memberEquality
Gets a value indicating whether the components of the first specified Vector2 are the same as the components of the second specified Vector2.
Public operatorStatic member(Vector2F to Vector2)
Explicit conversion from Vector2F
Public operatorStatic member(Vector2U to Vector2)
Explicit conversion from Vector2U
Public operatorStatic memberInequality
Gets a value indicating whether the components of the first specified Vector2 are not the same as the components of the second specified Vector2.
Public operatorStatic memberMultiply(Vector2, Vector2)
Multiplicates the first Vector2 by the second one.
Public operatorStatic memberMultiply(Vector2, Single)
Multiplicates the given Vector2 by the scalar.
Public operatorStatic memberSubtraction
Subtracts the first Vector2 from the second one.
Public operatorStatic memberUnaryNegation
Negates the given Vector2.
Public operatorStatic memberUnaryPlus
Returns the given Vector2.
Top
Fields
  NameDescription
Public fieldStatic memberOne
A Vector2 with the X and Y components being 1.
Public fieldStatic memberSizeInBytes
Gets the size of this structure.
Public fieldStatic memberValueCount
Gets the amount of value types required to represent this structure.
Public fieldX
The X integer component.
Public fieldY
The Y integer component.
Public fieldStatic memberZero
A Vector2 with the X and Y components being 0.
Top
See Also