public final class Vector2 extends Object implements com.aspose.threed.Struct<Vector2>, Serializable
Modifier and Type | Field and Description |
---|---|
double |
x
The x component.
|
double |
y
The y component.
|
Constructor and Description |
---|
Vector2() |
Vector2(double s)
Initializes a new instance of the
Vector2 struct. |
Vector2(double x,
double y)
Initializes a new instance of the
Vector2 struct. |
Modifier and Type | Method and Description |
---|---|
static Vector2 |
add(Vector2 lhs,
Vector2 rhs)
Addition operator for Vector2
|
Vector2 |
clone() |
void |
copyFrom(Vector2 src) |
static Vector2 |
div(Vector2 lhs,
double rhs)
Division operator for Vector2
|
double |
dot(Vector2 rhs)
Gets the dot product of two vectors
|
boolean |
equals(Object obj)
Check if two vector2 equals
|
boolean |
equals(Vector2 rhs)
Check if two vector2 equals
|
double |
getLength()
Gets the length.
|
double |
getU()
Gets the U component if the
Vector2 is used as a mapping coordinate. |
double |
getV()
Gets the V component if the
Vector2 is used as a mapping coordinate. |
int |
hashCode()
Gets the hash code of Vector2
|
static Vector2 |
mul(double lhs,
Vector2 rhs)
Multiply operator for Vector2
|
static Vector2 |
mul(Vector2 lhs,
double rhs)
Multiply operator for Vector2
|
static boolean |
op_eq(Vector2 lhs,
Vector2 rhs)
Equal operator for Vector2
|
static boolean |
op_ne(Vector2 lhs,
Vector2 rhs)
Not-equal operator for Vector2
|
void |
setU(double value)
Sets the U component if the
Vector2 is used as a mapping coordinate. |
void |
setV(double value)
Sets the V component if the
Vector2 is used as a mapping coordinate. |
static Vector2 |
sub(Vector2 lhs,
Vector2 rhs)
Substraction operator for Vector2
|
String |
toString()
|
public Vector2(double s)
Vector2
struct.s
- S.public Vector2(double x, double y)
Vector2
struct.x
- The x coordinate.y
- The y coordinate.public Vector2()
public double getU()
Vector2
is used as a mapping coordinate.
It's an alias of x component.public void setU(double value)
Vector2
is used as a mapping coordinate.
It's an alias of x component.value
- New valuepublic double getV()
Vector2
is used as a mapping coordinate.
It's an alias of y component.public void setV(double value)
Vector2
is used as a mapping coordinate.
It's an alias of y component.value
- New valuepublic double dot(Vector2 rhs)
rhs
- Right hand side value.public double getLength()
public static Vector2 add(Vector2 lhs, Vector2 rhs)
lhs
- Left hand side value.rhs
- Right hand side value.public static Vector2 sub(Vector2 lhs, Vector2 rhs)
lhs
- Left hand side value.rhs
- Right hand side value.public static Vector2 div(Vector2 lhs, double rhs)
lhs
- Left hand side value.rhs
- Right hand side value.public static Vector2 mul(Vector2 lhs, double rhs)
lhs
- Left hand side value.rhs
- Right hand side value.public static Vector2 mul(double lhs, Vector2 rhs)
lhs
- Left hand side value.rhs
- Right hand side value.public static boolean op_eq(Vector2 lhs, Vector2 rhs)
lhs
- Left hand side value.rhs
- Right hand side value.public static boolean op_ne(Vector2 lhs, Vector2 rhs)
lhs
- Left hand side value.rhs
- Right hand side value.public boolean equals(Vector2 rhs)
rhs
- The right hand side value.public boolean equals(Object obj)
public String toString()
public Vector2 clone()
public void copyFrom(Vector2 src)
copyFrom
in interface com.aspose.threed.Struct<Vector2>
Copyright © 2018. All rights reserved.