Package com.aspose.threed
Class Vector4
- java.lang.Object
-
- com.aspose.threed.Vector4
-
- All Implemented Interfaces:
com.aspose.threed.Struct<Vector4>
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable<Vector4>
public final class Vector4 extends java.lang.Object implements java.lang.Comparable<Vector4>, com.aspose.threed.Struct<Vector4>, java.io.Serializable
A vector with four components.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Vector4()
Vector4(double x, double y, double z)
Initializes a new instance of theVector4
struct.Vector4(double x, double y, double z, double w)
Initializes a new instance of theVector4
struct.Vector4(FVector4 vec)
Initializes a new instance of theVector4
struct.Vector4(Vector3 vec)
Initializes a new instance of theVector4
struct.Vector4(Vector3 vec, double w)
Initializes a new instance of theVector4
struct.Vector4(java.awt.Color color)
Initializes a new instance of theVector4
struct.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Vector4
add(Vector4 lhs, Vector4 rhs)
Operator overloading for +Vector4
clone()
int
compareTo(Vector4 other)
Compare current vector to another instance.void
copyFrom(Vector4 src)
static FVector4
create(Vector4 v)
Explicit conversion operator to cast Vector4 to FVector4boolean
equals(java.lang.Object obj)
Check if two vectors are equalint
hashCode()
Gets the hash code of this vectorstatic Vector4
mul(Vector4 lhs, double rhs)
Operator overloading for *static Vector4
mul(Vector4 lhs, Vector4 rhs)
Operator overloading for *void
set(double newX, double newY, double newZ)
Sets vector's xyz components at a time, w will be set to 1void
set(double newX, double newY, double newZ, double newW)
Sets vector's all components at a timestatic Vector4
sub(Vector4 lhs, Vector4 rhs)
Operator overloading for - (minus)java.lang.String
toString()
Returns aString
that represents the currentVector4
.
-
-
-
Constructor Detail
-
Vector4
public Vector4(java.awt.Color color)
Initializes a new instance of theVector4
struct.- Parameters:
color
- Color.
-
Vector4
public Vector4(Vector3 vec, double w)
Initializes a new instance of theVector4
struct.- Parameters:
vec
- Vec.w
- The width.
-
Vector4
public Vector4(Vector3 vec)
Initializes a new instance of theVector4
struct.- Parameters:
vec
- Vec.
-
Vector4
public Vector4(FVector4 vec)
Initializes a new instance of theVector4
struct.- Parameters:
vec
- Vec.
-
Vector4
public Vector4(double x, double y, double z)
Initializes a new instance of theVector4
struct.- Parameters:
x
- The x coordinate.y
- The y coordinate.z
- The z coordinate.
-
Vector4
public Vector4(double x, double y, double z, double w)
Initializes a new instance of theVector4
struct.- Parameters:
x
- The x coordinate.y
- The y coordinate.z
- The z coordinate.w
- The width.
-
Vector4
public Vector4()
-
-
Method Detail
-
add
public static Vector4 add(Vector4 lhs, Vector4 rhs)
Operator overloading for +- Parameters:
lhs
- The left vectorrhs
- The right vector- Returns:
- Result vector
-
sub
public static Vector4 sub(Vector4 lhs, Vector4 rhs)
Operator overloading for - (minus)- Parameters:
lhs
- The left vectorrhs
- The right vector- Returns:
- Result vector
-
mul
public static Vector4 mul(Vector4 lhs, Vector4 rhs)
Operator overloading for *- Parameters:
lhs
- The left vectorrhs
- The right vector- Returns:
- Result vector
-
mul
public static Vector4 mul(Vector4 lhs, double rhs)
Operator overloading for *- Parameters:
lhs
- The left vectorrhs
- The right double value- Returns:
- Result vector
-
create
public static FVector4 create(Vector4 v)
Explicit conversion operator to cast Vector4 to FVector4- Parameters:
v
-
-
set
public void set(double newX, double newY, double newZ)
Sets vector's xyz components at a time, w will be set to 1- Parameters:
newX
- New X component.newY
- New Y component.newZ
- New Z component.
-
equals
public boolean equals(java.lang.Object obj)
Check if two vectors are equal- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
-
-
set
public void set(double newX, double newY, double newZ, double newW)
Sets vector's all components at a time- Parameters:
newX
- New X component.newY
- New Y component.newZ
- New Z component.newW
- New W component.
-
toString
public java.lang.String toString()
Returns aString
that represents the currentVector4
.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A
String
that represents the currentVector4
.
-
compareTo
public int compareTo(Vector4 other)
Compare current vector to another instance.- Specified by:
compareTo
in interfacejava.lang.Comparable<Vector4>
- Parameters:
other
-
-
clone
public Vector4 clone()
- Specified by:
clone
in interfacecom.aspose.threed.Struct<Vector4>
- Overrides:
clone
in classjava.lang.Object
-
copyFrom
public void copyFrom(Vector4 src)
- Specified by:
copyFrom
in interfacecom.aspose.threed.Struct<Vector4>
-
hashCode
public int hashCode()
Gets the hash code of this vector- Overrides:
hashCode
in classjava.lang.Object
-
-