public final class Vector3 extends java.lang.Object implements 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(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 +
|
Vector3 |
clone() |
void |
copyFrom(Vector3 src) |
Vector3 |
cos()
Calculates cosine on each component
|
Vector3 |
cross(Vector3 rhs)
Cross product of two vectors
|
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(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.Object
obj
- The object to check equality.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.Vector3
s.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 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.Object
String
that represents the current Vector3
.public Vector3 clone()
clone
in interface com.aspose.threed.Struct<Vector3>
clone
in class java.lang.Object
public void copyFrom(Vector3 src)
copyFrom
in interface com.aspose.threed.Struct<Vector3>
public int hashCode()
hashCode
in class java.lang.Object
Vector3