public class Vec3f extends Object
Modifier and Type | Field and Description |
---|---|
float |
x
The x coordinate.
|
float |
y
The y coordinate.
|
float |
z
The z coordinate.
|
Constructor and Description |
---|
Vec3f() |
Vec3f(float x,
float y,
float z) |
Vec3f(Vec3f v) |
Modifier and Type | Method and Description |
---|---|
void |
add(Vec3f t1)
Sets the value of this vector to the sum of
itself and vector t1 (this = this + t1) .
|
void |
add(Vec3f t1,
Vec3f t2)
Sets the value of this vector to the sum
of vectors t1 and t2 (this = t1 + t2).
|
void |
cross(Vec3f v1,
Vec3f v2)
Sets this vector to be the vector cross product of vectors v1 and v2.
|
float |
dot(Vec3f v1)
Computes the dot product of this vector and vector v1.
|
boolean |
equals(Object obj)
Determines whether or not two 3D points or vectors are equal.
|
int |
hashCode()
Returns the hashcode for this
Vec3f . |
float |
length()
Returns the length of this vector.
|
void |
mul(float s) |
void |
normalize()
Normalize this vector.
|
void |
set(float x,
float y,
float z) |
void |
set(Vec3f v) |
void |
sub(Vec3f t1)
Sets the value of this vector to the difference of
itself and vector t1 (this = this - t1) .
|
void |
sub(Vec3f t1,
Vec3f t2)
Sets the value of this vector to the difference
of vectors t1 and t2 (this = t1 - t2).
|
String |
toString()
Returns a
String that represents the value
of this Vec3f . |
public float x
public float y
public float z
public Vec3f()
public Vec3f(float x, float y, float z)
public Vec3f(Vec3f v)
public void set(Vec3f v)
public void set(float x, float y, float z)
public final void mul(float s)
public void sub(Vec3f t1, Vec3f t2)
t1
- the first vectort2
- the second vectorpublic void sub(Vec3f t1)
t1
- the other vectorpublic void add(Vec3f t1, Vec3f t2)
t1
- the first vectort2
- the second vectorpublic void add(Vec3f t1)
t1
- the other vectorpublic float length()
public void normalize()
public void cross(Vec3f v1, Vec3f v2)
v1
- the first vectorv2
- the second vectorpublic float dot(Vec3f v1)
v1
- the other vectorpublic int hashCode()
Vec3f
.public boolean equals(Object obj)
Vec3f
are equal if the values of their
x
, y
and z
member fields,
representing their position in the coordinate space, are the same.Copyright © 2020. All rights reserved.