Struct Vector2
Represents a 2D Vector (type/units aren't specified)
Implements
Namespace: Anki.Vector.Types
Assembly: Anki.Vector.dll
Syntax
public struct Vector2 : IEquatable<Vector2>
Constructors
| Improve this Doc View SourceVector2(Single, Single)
Initializes a new instance of the Vector2 struct.
public Vector2(float x, float y)
Parameters
Type | Name | Description |
---|---|---|
Single | x | The x. |
Single | y | The y. |
Properties
| Improve this Doc View SourceX
Gets the x component
public float X { get; }
Property Type
Single |
Y
Gets the y component
public float Y { get; }
Property Type
Single |
Methods
| Improve this Doc View SourceEquals(Vector2)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Vector2 other)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
Boolean | true if the current object is equal to the |
Equals(Object)
Determines whether the specified Object, is equal to this instance.
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | The Object to compare with this instance. |
Returns
Type | Description |
---|---|
Boolean |
|
Overrides
| Improve this Doc View SourceGetHashCode()
Returns a hash code for this instance.
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
| Improve this Doc View SourceToString()
Converts to string.
public override string ToString()
Returns
Type | Description |
---|---|
String | A String that represents this instance. |
Overrides
Operators
| Improve this Doc View SourceAddition(Vector2, Vector2)
Implements the addition operator.
public static Vector2 operator +(Vector2 lhs, Vector2 rhs)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | lhs | The left value. |
Vector2 | rhs | The right value. |
Returns
Type | Description |
---|---|
Vector2 | Sum of 2 instances |
Division(Vector2, Int32)
Implements the division operator.
public static Vector2 operator /(Vector2 vector, int value)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | vector | The Vector. |
Int32 | value | The value to divide by |
Returns
Type | Description |
---|---|
Vector2 | The Vector divided by the value |
Division(Vector2, Single)
Implements the division operator.
public static Vector2 operator /(Vector2 vector, float value)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | vector | The Vector. |
Single | value | The value to divide by |
Returns
Type | Description |
---|---|
Vector2 | The Vector divided by the value |
Equality(Vector2, Vector2)
Implements the operator ==.
public static bool operator ==(Vector2 lhs, Vector2 rhs)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | lhs | The LHS. |
Vector2 | rhs | The RHS. |
Returns
Type | Description |
---|---|
Boolean | The result of the operator. |
Inequality(Vector2, Vector2)
Implements the operator !=.
public static bool operator !=(Vector2 lhs, Vector2 rhs)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | lhs | The LHS. |
Vector2 | rhs | The RHS. |
Returns
Type | Description |
---|---|
Boolean | The result of the operator. |
Multiply(Vector2, Int32)
Implements the multiplication operator.
public static Vector2 operator *(Vector2 vector, int value)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | vector | The Vector. |
Int32 | value | The value to multiply by |
Returns
Type | Description |
---|---|
Vector2 | The Vector multiplied by the value |
Multiply(Vector2, Single)
Implements the multiplication operator.
public static Vector2 operator *(Vector2 vector, float value)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | vector | The Vector. |
Single | value | The value to multiply by |
Returns
Type | Description |
---|---|
Vector2 | The Vector multiplied by the value |
Subtraction(Vector2, Vector2)
Implements the subtraction operator.
public static Vector2 operator -(Vector2 lhs, Vector2 rhs)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | lhs | The left value. |
Vector2 | rhs | The right value. |
Returns
Type | Description |
---|---|
Vector2 | Difference of 2 instances |