Vector2
Contents
[
Hide
]Vector2 class
A vector with two components.
Properties
Name | Description |
---|---|
x | The x component. |
y | The y component. |
Methods
constructor
Name | Description |
---|---|
constructor() |
Result:
constructor_overload
Name | Description |
---|---|
constructor_overload(s) | Initializes a new instance of the Vector2 struct. |
Parameters:
Name | Type | Description |
---|---|---|
s | Number | S. |
Result:
constructor_overload$2{#constructor_overload$2}
Name | Description |
---|---|
constructor_overload$2(vec) | Initializes a new instance of the Vector2 struct. |
Parameters:
Name | Type | Description |
---|---|---|
vec | FVector2 | Vector in float. |
Result:
constructor_overload$3{#constructor_overload$3}
Name | Description |
---|---|
constructor_overload$3(x, y) | Initializes a new instance of the Vector2 struct. |
Parameters:
Name | Type | Description |
---|---|---|
x | Number | The x coordinate. |
y | Number | The y coordinate. |
Result:
getU
Name | Description |
---|---|
getU() | Gets or sets the U component if the Vector2 is used as a mapping coordinate. It’s an alias of x component. |
Result:
setU
Name | Description |
---|---|
setU(value) | Gets or sets the U component if the Vector2 is used as a mapping coordinate. It’s an alias of x component. |
Result:
getV
Name | Description |
---|---|
getV() | Gets or sets the V component if the Vector2 is used as a mapping coordinate. It’s an alias of y component. |
Result:
setV
Name | Description |
---|---|
setV(value) | Gets or sets the V component if the Vector2 is used as a mapping coordinate. It’s an alias of y component. |
Result:
getLength
Name | Description |
---|---|
getLength() | Gets the length. The length. |
Result:
dot
Name | Description |
---|---|
dot(rhs) | Gets the dot product of two vectors |
Parameters:
Name | Type | Description |
---|---|---|
rhs | Vector2 | Right hand side value. |
Result: Number
equals
Name | Description |
---|---|
equals(rhs) | Check if two vector2 equals |
Parameters:
Name | Type | Description |
---|---|---|
rhs | Vector2 | The right hand side value. |
Result: boolean
hashCode
Name | Description |
---|---|
hashCode() | Gets the hash code of Vector2 |
Result: Number
equals
Name | Description |
---|---|
equals(obj) | Check if two vector2 equals |
Parameters:
Name | Type | Description |
---|---|---|
obj | Object | The object to compare. |
Result: boolean
toString
Name | Description |
---|---|
toString() | Returns a java.lang.String that represents the current Vector2. |
Result: String
cross
Name | Description |
---|---|
cross(v) | Cross product of two vectors |
Parameters:
Name | Type | Description |
---|---|---|
Vector2 | null |
Result: Number
normalize
Name | Description |
---|---|
normalize() | Normalizes this instance. |
Result: Vector2
compareTo
Name | Description |
---|---|
compareTo(other) | Compare current vector to another instance. |
Parameters:
Name | Type | Description |
---|---|---|
othe | Vector2 | null |
Result: Number