nl.kun.Engine3D
Class TPhysObject
java.lang.Object
|
+--nl.kun.Engine3D.TVector3D
|
+--nl.kun.Engine3D.TCoordSys3D
|
+--nl.kun.Engine3D.TEntity3D
|
+--nl.kun.Engine3D.TEntityList3D
|
+--nl.kun.Engine3D.TPhysObject
- Direct Known Subclasses:
- TPendulum
- public class TPhysObject
- extends TEntityList3D
An object that adds physical quantities to TEntityList3D
. It is really not complete enough
and should really be extended with more variables and functionality. It's main purpose at this moment is
to be able to rotate an object quite easily around a fixed axis, and to track the position in the global coordinate
system of certain points (fixed in the objects local coordinate space).
Field Summary |
static int |
GLOBAL
Used to tell a method to use global coordinates. |
static int |
LOCAL
Used to tell a method to use local coordinates. |
double |
Mass
The mass of the object |
(package private) static int |
MAXPICKPOINTS
The maximum amount of fixed points it should be able to track |
TVector3D |
v
The velocity of the object |
Constructor Summary |
TPhysObject()
Empty constructor. |
TPhysObject(double _x,
double _y,
double _z,
double _xax,
double _xay,
double _xaz,
double _yax,
double _yay,
double _yaz,
double _zax,
double _zay,
double _zaz)
Constructor. |
TPhysObject(TVector3D _Posvec,
TVector3D _Xaxis,
TVector3D _Yaxis,
TVector3D _Zaxis)
Constructor. |
Method Summary |
TVector3D |
getPickPoint(int _i)
returns the position (in global coordinate system) of a certain fixed point on the object. |
void |
init(double _Mass,
TVector3D _v)
Optional initialize. |
void |
rotAroundFixedAxis(double _angle)
Rotates the object around the fixed axis by an amount _angle . |
void |
setFixedAxis(TVector3D _FixedAxisPos,
TVector3D _FixedAxisDir,
int _Locality)
Sets the fixed rotation axis for this object. |
void |
setPickPoint(TVector3D _PickPoint,
int _Locality,
int _i)
Sets a point fixed in the local coordinate system of this object. |
Methods inherited from class nl.kun.Engine3D.TEntityList3D |
Append,
Clear,
Depth,
Draw,
InheritGlobalCords,
Insert,
Remove,
Remove,
Rotate,
Sort,
Translate,
Translate |
Methods inherited from class nl.kun.Engine3D.TVector3D |
Angle,
Double2String,
Double2String,
Modulus,
Modulus,
Negate,
Negate,
Normalize,
Normalize,
NulVec,
StdXaxis,
StdYaxis,
StdZaxis,
String2Double,
VAdd,
VCrossProduct,
VCrossProduct,
VDotProduct,
Vector3D,
VPerpendicular,
VPerpendicular,
VScalarProduct,
VScalarProduct,
VScalarProduct,
VSubstract,
VSubstract |
Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Mass
public double Mass
- The mass of the object
MAXPICKPOINTS
static int MAXPICKPOINTS
- The maximum amount of fixed points it should be able to track
v
public TVector3D v
- The velocity of the object
GLOBAL
public static int GLOBAL
- Used to tell a method to use global coordinates. Static variable.
LOCAL
public static int LOCAL
- Used to tell a method to use local coordinates. Static variable.
TPhysObject
public TPhysObject(double _x,
double _y,
double _z,
double _xax,
double _xay,
double _xaz,
double _yax,
double _yay,
double _yaz,
double _zax,
double _zay,
double _zaz)
- Constructor.
- Parameters:
_x
- the x-value of the origin vector_y
- the y-value of the origin vector_z
- the z-value of the origin vector_xax
- the x-value of the x-axis vector_xay
- the y-value of the x-axis vector_xaz
- the z-value of the x-axis vector_yax
- the x-value of the y-axis vector_yay
- the y-value of the y-axis vector_yaz
- the z-value of the y-axis vector_zax
- the x-value of the z-axis vector_zay
- the y-value of the z-axis vector_zaz
- the z-value of the z-axis vector
TPhysObject
public TPhysObject(TVector3D _Posvec,
TVector3D _Xaxis,
TVector3D _Yaxis,
TVector3D _Zaxis)
- Constructor.
- Parameters:
_Posvec
- The origin vector_Xaxis
- The x-axis vector_Yaxis
- The y-axis vector_Zaxis
- The z-axis vector
TPhysObject
public TPhysObject()
- Empty constructor. Creates an object with coordinate system: ( (0,0,0); (1,0,0); (0,1,0); (0,0,1) )
init
public void init(double _Mass,
TVector3D _v)
- Optional initialize. Can be used to initialise mass en velocity of the object.
- Parameters:
_Mass
- Mass of the object_v
- Velocity of the object
setFixedAxis
public void setFixedAxis(TVector3D _FixedAxisPos,
TVector3D _FixedAxisDir,
int _Locality)
- Sets the fixed rotation axis for this object.
- Parameters:
_FixedAxisPos
- Position vector for the fixed rotation axis._FixedAxisDir
- Direction vector for the fixed rotation axis._Locality
- Can be either TPendulum.GLOBAL
or TPendulum.LOCAL
, depending on in what
coordinate system the axis is defined, global or local.- See Also:
GLOBAL
,
LOCAL
setPickPoint
public void setPickPoint(TVector3D _PickPoint,
int _Locality,
int _i)
- Sets a point fixed in the local coordinate system of this object.
- Parameters:
_PickPoint
- The position vector of the point_Locality
- Can be either TPendulum.GLOBAL
or TPendulum.LOCAL
, depending on in what
coordinate system the point is defined._i
- Which pickpoint (0 to MAXPICKPOINTS
) to set.- See Also:
GLOBAL
,
LOCAL
getPickPoint
public TVector3D getPickPoint(int _i)
- returns the position (in global coordinate system) of a certain fixed point on the object.
- Parameters:
_i
- Which pickpoint you want to get (0 to MAXPICKPOINTS
)
rotAroundFixedAxis
public void rotAroundFixedAxis(double _angle)
- Rotates the object around the fixed axis by an amount
_angle
.
- Parameters:
_angle
- The angle (in radians) to rotate the object.