|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--nl.kun.Engine3D.TVector3D
The TVector3D class is the basic class for all 3D classes and contains all information to define a vector in 3D. It also contains a lot of functions that can manipulate vectors
| Field Summary | |
static int |
DBSCIENTIFIC
Static macro for use in Double2String. |
static int |
DBSTANDARD
Static macro for use in Double2String. |
double |
x
The x part of the vector. |
double |
y
The y part of the vector. |
double |
z
The z part of the vector. |
| Constructor Summary | |
TVector3D()
Empty constructor. |
|
TVector3D(double _x,
double _y,
double _z)
Standard constructor. |
|
TVector3D(TVector3D _p)
Copy constructor. |
|
| Method Summary | |
protected double |
Angle(TVector3D _a,
TVector3D _b)
Calculates the angle between TVector3D's _a and
_b. |
static java.lang.String |
Double2String(double _x,
int _digits)
Converts a double to a String in DBSTANDARD mode. |
static java.lang.String |
Double2String(double _x,
int _digits,
int _mode)
A method to convert a double to a String with a certain roundoff.
|
double |
Modulus()
The modulus of the vector |
double |
Modulus(TVector3D _b)
The modulus of a vector |
protected TVector3D |
Negate()
Negates this vector |
protected TVector3D |
Negate(TVector3D _b)
Negates vector _b. |
TVector3D |
Normalize()
Normalizes this vector |
TVector3D |
Normalize(TVector3D _b)
Normalizes the vector _b |
static TVector3D |
NulVec()
A vector with all elements zero |
void |
Rotate(TVector3D _PosVec,
TVector3D _DirVec,
double _Angle)
Rotates this vector around the line that is build op by a position vector and a direction vector by an amount _Angle |
static TVector3D |
StdXaxis()
A standard vector for a X axis. |
static TVector3D |
StdYaxis()
A standard vector for a Y axis. |
static TVector3D |
StdZaxis()
A standard vector for a Z axis. |
static double |
String2Double(java.lang.String _string)
Converts a String to a double. |
java.lang.String |
toString()
Used when a string version of this object is needed |
TVector3D |
Translate(double _dx,
double _dy,
double _dz)
Translates this vector. |
TVector3D |
Translate(TVector3D _dV)
Translates this vector by another vector. |
protected TVector3D |
VAdd(TVector3D _a,
TVector3D _b)
Adds vector _a and _b from |
protected TVector3D |
VCrossProduct(TVector3D _a,
TVector3D _b)
Calculates the crossproduct of vector _a and the vector _b |
protected TVector3D |
VCrossProduct(TVector3D _a,
TVector3D _b,
TVector3D _c)
Calculates the crossproduct of vector _a and the vector _b,
and returns the result in vector _c |
protected double |
VDotProduct(TVector3D _a,
TVector3D _b)
Calculates the dotproduct of vector _a and _b from |
TVector3D |
Vector3D()
This object |
TVector3D |
Vector3D(double _x,
double _y,
double _z)
This object. |
TVector3D |
Vector3D(TVector3D _pos)
This object. |
protected TVector3D |
VPerpendicular(TVector3D _b)
Calculates a vector that is perpendicular to vector _b |
protected TVector3D |
VPerpendicular(TVector3D _b,
TVector3D _a)
Calculates a vector that is perpendicular to vector _b
and returns it's result in vector _a |
protected TVector3D |
VScalarProduct(double _alpha)
Calculates the scalar product of this vector and the double _alpha |
protected TVector3D |
VScalarProduct(TVector3D _a,
double _alpha)
Calculates the scalar product of vector _a and the double _alpha |
protected TVector3D |
VScalarProduct(TVector3D _a,
double _alpha,
TVector3D _b)
Calculates the scalar product of the vector _a and the double _alpha and
puts the result in _b |
protected TVector3D |
VSubstract(TVector3D _b)
Substracts vector _b from this vector |
protected TVector3D |
VSubstract(TVector3D _a,
TVector3D _b)
Substracts vector _b from _a so _a-_b |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public double x
public double y
public double z
public static int DBSCIENTIFIC
Double2String.Double2String(double,int)public static int DBSTANDARD
Double2String.Double2String(double,int)| Constructor Detail |
public TVector3D(double _x,
double _y,
double _z)
public TVector3D(TVector3D _p)
_p - An other TVector3D that will be copied into this object.public TVector3D()
| Method Detail |
public static TVector3D NulVec()
public static TVector3D StdXaxis()
public static TVector3D StdYaxis()
public static TVector3D StdZaxis()
public final TVector3D Vector3D()
public TVector3D Vector3D(TVector3D _pos)
_pos - Another TVector3D which values are copied in this object
public TVector3D Vector3D(double _x,
double _y,
double _z)
public final double Modulus()
public final double Modulus(TVector3D _b)
_b - A TVector3D object to determine the modulus forpublic final TVector3D Normalize()
public final TVector3D Normalize(TVector3D _b)
_b_b - a TVector3D that is to be normalized
public TVector3D Translate(double _dx,
double _dy,
double _dz)
_dx - the translation in x direction_dy - the translation in y direction_dz - the translation in z directionpublic TVector3D Translate(TVector3D _dV)
_dV - the translation vector
protected final double Angle(TVector3D _a,
TVector3D _b)
TVector3D's _a and
_b. When the dotproduct between _a and _b <0, the angle is negated._a - the first vector_b - the second vector
protected final TVector3D VScalarProduct(TVector3D _a,
double _alpha)
_a and the double _alpha_a - The vector_alpha - the scalarprotected final TVector3D VScalarProduct(double _alpha)
_alpha - the scalar
protected final TVector3D VScalarProduct(TVector3D _a,
double _alpha,
TVector3D _b)
_a and the double _alpha and
puts the result in _b_alpha - the scalar_a - the vector to be multiplied with_b - the result vectorprotected final TVector3D Negate()
protected final TVector3D Negate(TVector3D _b)
_b._b - the vector to be negated.
protected final TVector3D VCrossProduct(TVector3D _a,
TVector3D _b)
_a and the vector _b_a - The first vector_b - The second vector
protected final TVector3D VCrossProduct(TVector3D _a,
TVector3D _b,
TVector3D _c)
_a and the vector _b,
and returns the result in vector _c_a - The first vector_b - The second vector_c - The result vector
protected final TVector3D VSubstract(TVector3D _a,
TVector3D _b)
_b from _a so _a-_b_a - The first vector_b - The second vectorprotected final TVector3D VSubstract(TVector3D _b)
_b from this vector_b - A vector which is substracted from this vector
protected final TVector3D VAdd(TVector3D _a,
TVector3D _b)
_a and _b from_a - The first vector_b - The second vector
protected final double VDotProduct(TVector3D _a,
TVector3D _b)
_a and _b from_a - The first vector_b - The second vectorprotected final TVector3D VPerpendicular(TVector3D _b)
_b_b - The vector for which a perpendicular vector should be found.
protected final TVector3D VPerpendicular(TVector3D _b,
TVector3D _a)
_b
and returns it's result in vector _a_b - The vector for which a perpendicular vector should be found._a - Result vectorpublic java.lang.String toString()
public void Rotate(TVector3D _PosVec,
TVector3D _DirVec,
double _Angle)
_PosVec - The position vector_DirVec - The direction vector_Angle - The rotation angle (in radians)
public static final java.lang.String Double2String(double _x,
int _digits,
int _mode)
double to a String with a certain roundoff.
It automatically uses exponential notation when the number is too large or
too small, but can also be set to use exponential notation always._x - The double to be converted_digits - the number of significant numbers in DBSCIENTIFIC mode.
or the number of digits in general (without the point) in DBSTANDARD mode._mode - kan be DBSCIENTIFIC or DBSTANDARD.
public static final java.lang.String Double2String(double _x,
int _digits)
double to a String in DBSTANDARD mode._x - The double to be converted_digits - the number of digits in general (without the point) in DBSTANDARD mode.public static final double String2Double(java.lang.String _string)
String to a double._string - the String to be converted to double.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||