public final class Vector3 extends java.lang.Object implements java.lang.Comparable<Vector3>, com.aspose.threed.Struct<Vector3>, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
static Vector3 |
ORIGIN
Gets the origin position.
|
static Vector3 |
UNIT_SCALE
Gets the unit scale vector.
|
double |
x
The x component.
|
static Vector3 |
X_AXIS
Gets the X axis.
|
double |
y
The y component.
|
static Vector3 |
Y_AXIS
Gets the Y axis.
|
double |
z
The z component.
|
static Vector3 |
Z_AXIS
Gets the Z axis.
|
| Constructor and Description |
|---|
Vector3() |
Vector3(java.awt.Color color)
Initializes a new instance of the
Vector3 struct. |
Vector3(double v)
Initializes a new instance of the
Vector3 struct. |
Vector3(double x,
double y,
double z)
Initializes a new instance of the
Vector3 struct. |
Vector3(FVector3 vec)
Initializes a new instance of the
Vector3 struct. |
Vector3(Vector4 vec4)
Initializes a new instance of the
Vector3 struct. |
| Modifier and Type | Method and Description |
|---|---|
static Vector3 |
add(Vector3 lhs,
Vector3 rhs)
Operator overloading for +
|
double |
angleBetween(Vector3 dir)
Calculate the inner angle between two direction
Two direction can be non-normalized vectors
|
double |
angleBetween(Vector3 dir,
Vector3 up)
Calculate the inner angle between two direction
Two direction can be non-normalized vectors
|
Vector3 |
clone() |
int |
compareTo(Vector3 other)
Compare current vector to another instance.
|
void |
copyFrom(Vector3 src) |
Vector3 |
cos()
Calculates cosine on each component
|
static FVector3 |
create(Vector3 v)
Explicit conversion operator to cast Vector3 to FVector3
|
Vector3 |
cross(Vector3 rhs)
Cross product of two vectors
|
static Vector3 |
div(Vector3 lhs,
double rhs)
Operator overloading for /
|
double |
dot(Vector3 rhs)
Gets the dot product of two vectors
|
boolean |
equals(java.lang.Object obj)
Check if two vector3 equals
|
double |
getLength()
Gets the length of this vector.
|
double |
getLength2()
Gets the square of the length.
|
int |
hashCode()
Gets the hash code of Vector3
|
static Vector3 |
mul(double lhs,
Vector3 rhs)
Operator overloading for *
|
static Vector3 |
mul(Vector3 lhs,
double rhs)
Operator overloading for *
|
static Vector3 |
mul(Vector3 lhs,
Vector3 rhs)
Operator overloading for *
|
static Vector3 |
negative(Vector3 v)
Operator overloading for -
|
Vector3 |
normalize()
Normalizes this instance.
|
static boolean |
op_eq(Vector3 lhs,
Vector3 rhs)
Equal operator for Vector3
|
static boolean |
op_ne(Vector3 lhs,
Vector3 rhs)
Not-equal operator for Vector3
|
void |
set(double newX,
double newY,
double newZ)
Sets the x/y/z component in one call.
|
Vector3 |
sin()
Calculates sine on each component
|
static Vector3 |
sub(Vector3 lhs,
Vector3 rhs)
Operator overloading for - (minus)
|
java.lang.String |
toString()
Returns a
String that represents the current Vector3. |
public double x
public double y
public double z
public static final Vector3 ORIGIN
public static final Vector3 UNIT_SCALE
public static final Vector3 X_AXIS
public static final Vector3 Y_AXIS
public static final Vector3 Z_AXIS
public Vector3(double x,
double y,
double z)
Vector3 struct.x - The x coordinate.y - The y coordinate.z - The z coordinate.public Vector3(FVector3 vec)
Vector3 struct.vec - The x coordinate.public Vector3(java.awt.Color color)
Vector3 struct.color - Color.public Vector3(double v)
Vector3 struct.v - V.public Vector3(Vector4 vec4)
Vector3 struct.vec4 - Vec4.public Vector3()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - The object to check equality.public static FVector3 create(Vector3 v)
v - public double dot(Vector3 rhs)
rhs - Right hand side value.public Vector3 normalize()
public double getLength2()
public double getLength()
public Vector3 cross(Vector3 rhs)
rhs - Right hand side value.Vector3s.public static Vector3 negative(Vector3 v)
v - The origin vectorpublic static Vector3 sub(Vector3 lhs, Vector3 rhs)
lhs - The left vectorrhs - The right vectorpublic static Vector3 add(Vector3 lhs, Vector3 rhs)
lhs - The left vectorrhs - The right vectorpublic static Vector3 mul(Vector3 lhs, Vector3 rhs)
lhs - The left vectorrhs - The right vectorpublic static Vector3 mul(double lhs, Vector3 rhs)
lhs - The left scalarrhs - The right vectorpublic static Vector3 mul(Vector3 lhs, double rhs)
lhs - The left vectorrhs - The right double valuepublic static Vector3 div(Vector3 lhs, double rhs)
lhs - The left vectorrhs - The right double valuepublic static boolean op_eq(Vector3 lhs, Vector3 rhs)
lhs - Left hand side value.rhs - Right hand side value.public static boolean op_ne(Vector3 lhs, Vector3 rhs)
lhs - Left hand side value.rhs - Right hand side value.public void set(double newX,
double newY,
double newZ)
newX - The x component.newY - The y component.newZ - The z component.public java.lang.String toString()
String that represents the current Vector3.toString in class java.lang.ObjectString that represents the current Vector3.public double angleBetween(Vector3 dir, Vector3 up)
dir - The direction vector to compare withup - The up vector of the two direction's shared planepublic double angleBetween(Vector3 dir)
dir - The direction vector to compare withpublic int compareTo(Vector3 other)
compareTo in interface java.lang.Comparable<Vector3>other - public Vector3 clone()
clone in interface com.aspose.threed.Struct<Vector3>clone in class java.lang.Objectpublic void copyFrom(Vector3 src)
copyFrom in interface com.aspose.threed.Struct<Vector3>public int hashCode()
hashCode in class java.lang.ObjectVector3