public class Vector3d
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static Vector3d |
UNIT_X |
static Vector3d |
UNIT_Y |
static Vector3d |
UNIT_Z |
double |
x |
double |
y |
double |
z |
static Vector3d |
ZERO |
Constructor and Description |
---|
Vector3d(double x,
double y,
double z)
Erzeugt einen neuen 3D-Vektor.
|
Vector3d(Vector3d v)
Copy-Konstruktor.
|
Modifier and Type | Method and Description |
---|---|
Vector3d |
add(Vector3d that)
Addiert einen Vektor zu diesem Vektor
|
int |
compareTo(Vector3d that) |
Vector3d |
copy() |
static Vector3d |
createVector3d(double x,
double y,
double z)
Gibt eine neue Instanz eines Vektors zurück.
|
static Vector3d |
createVector3d(Vector3d v)
Gibt eine Kopie des übergebenen Vektors zurück.
|
Vector3d |
cross(Vector3d that)
Kreuzprodukt zweier Vektoren
|
double |
dot(Vector3d that)
Skalarprodukt mit einem anderen Vektor
|
boolean |
equals(java.lang.Object o) |
double |
getX() |
double |
getY() |
double |
getZ() |
int |
hashCode() |
double |
length()
Die Länge des Vektors
|
double |
lengthSquared()
Die quadrierte Länge des Vektors
|
Vector3d |
normalize()
Gibt den Vektor normalisiert zurück.
|
void |
setX(double x) |
void |
setY(double y) |
void |
setZ(double z) |
Vector3d |
sub(Vector3d that)
Subtrahiert einen Vektor von diesem Vektor.
|
Vector3d |
times(double s)
Multipliziert diesen Vektor mit einem Skalar
|
Matrix |
toMatrix()
Gibt den Vektor in einer 4d Matrix zurück.
|
java.lang.String |
toString() |
Vertex3f |
toVertex3f() |
Vector3d |
transform(Matrix transformation)
Transformiert den Vektor mithilfe einer Transformationsmatrix und gibt eine Kopie des transformierten Vektors zurück.
|
Vector3d |
travel(Vector3d direction,
double t)
Bewegt den Vektor entlang eines Richtungsvektors um den Faktorwert t.
|
public static final Vector3d UNIT_X
public static final Vector3d UNIT_Y
public static final Vector3d UNIT_Z
public static final Vector3d ZERO
public double x
public double y
public double z
public Vector3d(double x, double y, double z)
x
- x-Komponentey
- y-Komponentez
- z-Komponentepublic Vector3d(Vector3d v)
v
- Vektor, der kopiert werden sollpublic static Vector3d createVector3d(double x, double y, double z)
x
- die x-Komponente des neuen Vektorsy
- die y-Komponente des neuen Vektorsz
- die z-Komponente des neuen Vektorspublic static Vector3d createVector3d(Vector3d v)
v
- der zu kopierende Vektorpublic java.lang.String toString()
toString
in class java.lang.Object
public double dot(Vector3d that)
that
- der andere Vektorpublic Vector3d cross(Vector3d that)
that
- der andere Vektorpublic Vector3d sub(Vector3d that)
that
- der andere Vektorpublic Vector3d add(Vector3d that)
that
- der andere Vektorpublic double length()
public double lengthSquared()
public Vector3d times(double s)
s
- die skalare Größepublic Vector3d normalize()
public Matrix toMatrix()
public double getX()
public double getY()
public double getZ()
public void setX(double x)
public void setY(double y)
public void setZ(double z)
public Vector3d transform(Matrix transformation)
transformation
- die Transformationsmatrixpublic Vector3d travel(Vector3d direction, double t)
direction
- die Richtungt
- der Faktorpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public Vector3d copy()
public Vertex3f toVertex3f()
public int compareTo(Vector3d that)