Vector2
Inheritance: java.lang.Object
All Implemented Interfaces: java.lang.Comparable, com.aspose.csporter.helpers.Struct, java.io.Serializable
public final class Vector2 implements Comparable<Vector2>, Struct<Vector2>, Serializable
A vector with two components.
Constructors
Constructor | Description |
---|---|
Vector2(double s) | Initializes a new instance of the Vector2 struct. |
Vector2(Vector3 s) | Initializes a new instance of the Vector2 struct. |
Vector2(FVector2 vec) | Initializes a new instance of the Vector2 struct. |
Vector2(double x, double y) | Initializes a new instance of the Vector2 struct. |
Vector2() |
Fields
Field | Description |
---|---|
x | The x component. |
y | The y component. |
Methods
Method | Description |
---|---|
add(Vector2 lhs, Vector2 rhs) | Addition operator for Vector2 |
clone() | |
compareTo(Vector2 other) | Compare current vector to another instance. |
copyFrom(Vector2 src) | |
create(Vector2 v) | Explicit conversion operator to cast Vector2 to FVector2 |
cross(Vector2 v) | Cross product of two vectors |
div(Vector2 lhs, double rhs) | Division operator for Vector2 |
dot(Vector2 rhs) | Gets the dot product of two vectors |
equals(Vector2 rhs) | Check if two vector2 equals |
equals(Object obj) | Check if two vector2 equals |
getClass() | |
getLength() | Gets the length. |
getU() | Gets the U component if the Vector2 is used as a mapping coordinate. |
getV() | Gets the V component if the Vector2 is used as a mapping coordinate. |
hashCode() | Gets the hash code of Vector2 |
mul(Vector2 lhs, double rhs) | Multiply operator for Vector2 |
mul(double lhs, Vector2 rhs) | Multiply operator for Vector2 |
normalize() | Normalizes this instance. |
notify() | |
notifyAll() | |
op_eq(Vector2 lhs, Vector2 rhs) | Equal operator for Vector2 |
op_ne(Vector2 lhs, Vector2 rhs) | Not-equal operator for Vector2 |
setU(double value) | Sets the U component if the Vector2 is used as a mapping coordinate. |
setV(double value) | Sets the V component if the Vector2 is used as a mapping coordinate. |
sub(Vector2 lhs, Vector2 rhs) | Subtraction operator for Vector2 |
toString() | Returns a java.lang.String that represents the current Vector2. |
wait() | |
wait(long arg0) | |
wait(long arg0, int arg1) |
Vector2(double s)
public Vector2(double s)
Initializes a new instance of the Vector2 struct.
Parameters:
Parameter | Type | Description |
---|---|---|
s | double | S. |
Vector2(Vector3 s)
public Vector2(Vector3 s)
Initializes a new instance of the Vector2 struct.
Parameters:
Parameter | Type | Description |
---|---|---|
s | Vector3 | S. |
Vector2(FVector2 vec)
public Vector2(FVector2 vec)
Initializes a new instance of the Vector2 struct.
Parameters:
Parameter | Type | Description |
---|---|---|
vec | FVector2 | Vector in float. |
Vector2(double x, double y)
public Vector2(double x, double y)
Initializes a new instance of the Vector2 struct.
Parameters:
Parameter | Type | Description |
---|---|---|
x | double | The x coordinate. |
y | double | The y coordinate. |
Vector2()
public Vector2()
x
public double x
The x component.
y
public double y
The y component.
add(Vector2 lhs, Vector2 rhs)
public static Vector2 add(Vector2 lhs, Vector2 rhs)
Addition operator for Vector2
Parameters:
Parameter | Type | Description |
---|---|---|
lhs | Vector2 | Left hand side value. |
rhs | Vector2 | Right hand side value. |
Returns: Vector2 - The result of addition.
clone()
public Vector2 clone()
Returns: Vector2
compareTo(Vector2 other)
public int compareTo(Vector2 other)
Compare current vector to another instance.
Parameters:
Parameter | Type | Description |
---|---|---|
other | Vector2 |
Returns: int
copyFrom(Vector2 src)
public void copyFrom(Vector2 src)
Parameters:
Parameter | Type | Description |
---|---|---|
src | Vector2 |
create(Vector2 v)
public static FVector2 create(Vector2 v)
Explicit conversion operator to cast Vector2 to FVector2
Parameters:
Parameter | Type | Description |
---|---|---|
v | Vector2 |
Returns: FVector2
cross(Vector2 v)
public double cross(Vector2 v)
Cross product of two vectors
Parameters:
Parameter | Type | Description |
---|---|---|
v | Vector2 |
Returns: double
div(Vector2 lhs, double rhs)
public static Vector2 div(Vector2 lhs, double rhs)
Division operator for Vector2
Parameters:
Parameter | Type | Description |
---|---|---|
lhs | Vector2 | Left hand side value. |
rhs | double | Right hand side value. |
Returns: Vector2 - The result of division.
dot(Vector2 rhs)
public double dot(Vector2 rhs)
Gets the dot product of two vectors
Parameters:
Parameter | Type | Description |
---|---|---|
rhs | Vector2 | Right hand side value. |
Returns: double - The dot product of the two vectors.
equals(Vector2 rhs)
public boolean equals(Vector2 rhs)
Check if two vector2 equals
Parameters:
Parameter | Type | Description |
---|---|---|
rhs | Vector2 | The right hand side value. |
Returns: boolean - True if all components are identically equal.
equals(Object obj)
public boolean equals(Object obj)
Check if two vector2 equals
Parameters:
Parameter | Type | Description |
---|---|---|
obj | java.lang.Object | The object to compare. |
Returns: boolean - True if all components are identically equal.
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class
getLength()
public double getLength()
Gets the length.
Returns: double
getU()
public double getU()
Gets the U component if the Vector2 is used as a mapping coordinate. It’s an alias of x component.
Returns: double
getV()
public double getV()
Gets the V component if the Vector2 is used as a mapping coordinate. It’s an alias of y component.
Returns: double
hashCode()
public int hashCode()
Gets the hash code of Vector2
Returns: int - The hash code of the Vector2
mul(Vector2 lhs, double rhs)
public static Vector2 mul(Vector2 lhs, double rhs)
Multiply operator for Vector2
Parameters:
Parameter | Type | Description |
---|---|---|
lhs | Vector2 | Left hand side value. |
rhs | double | Right hand side value. |
Returns: Vector2 - The result of multiply.
mul(double lhs, Vector2 rhs)
public static Vector2 mul(double lhs, Vector2 rhs)
Multiply operator for Vector2
Parameters:
Parameter | Type | Description |
---|---|---|
lhs | double | Left hand side value. |
rhs | Vector2 | Right hand side value. |
Returns: Vector2 - The result of multiply.
normalize()
public Vector2 normalize()
Normalizes this instance.
Returns: Vector2 - Normalized vector.
notify()
public final native void notify()
notifyAll()
public final native void notifyAll()
op_eq(Vector2 lhs, Vector2 rhs)
public static boolean op_eq(Vector2 lhs, Vector2 rhs)
Equal operator for Vector2
Parameters:
Parameter | Type | Description |
---|---|---|
lhs | Vector2 | Left hand side value. |
rhs | Vector2 | Right hand side value. |
Returns: boolean - True if all components are identically equal.
op_ne(Vector2 lhs, Vector2 rhs)
public static boolean op_ne(Vector2 lhs, Vector2 rhs)
Not-equal operator for Vector2
Parameters:
Parameter | Type | Description |
---|---|---|
lhs | Vector2 | Left hand side value. |
rhs | Vector2 | Right hand side value. |
Returns: boolean - True if two vectors are not equal.
setU(double value)
public void setU(double value)
Sets the U component if the Vector2 is used as a mapping coordinate. It’s an alias of x component.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | New value |
setV(double value)
public void setV(double value)
Sets the V component if the Vector2 is used as a mapping coordinate. It’s an alias of y component.
Parameters:
Parameter | Type | Description |
---|---|---|
value | double | New value |
sub(Vector2 lhs, Vector2 rhs)
public static Vector2 sub(Vector2 lhs, Vector2 rhs)
Subtraction operator for Vector2
Parameters:
Parameter | Type | Description |
---|---|---|
lhs | Vector2 | Left hand side value. |
rhs | Vector2 | Right hand side value. |
Returns: Vector2 - The result of substraction.
toString()
public String toString()
Returns a java.lang.String that represents the current Vector2.
Returns: java.lang.String - A java.lang.String that represents the current Vector2.
wait()
public final void wait()
wait(long arg0)
public final void wait(long arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long | |
arg1 | int |