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
 
Fields inherited from class nl.kun.Engine3D.TEntityList3D
depth, index, MaxBuf, MAXOBJECTS, ObjectList, size
 
Fields inherited from class nl.kun.Engine3D.TEntity3D
color, GlobalCords, ParentGlobalCords, Vissible
 
Fields inherited from class nl.kun.Engine3D.TCoordSys3D
Xaxis, Yaxis, Zaxis
 
Fields inherited from class nl.kun.Engine3D.TVector3D
DBSCIENTIFIC, DBSTANDARD, x, y, z
 
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.TEntity3D
Vector3D, Vector3D
 
Methods inherited from class nl.kun.Engine3D.TCoordSys3D
CoordSys3D, CoordSys3D, CoordSys3D, Global2Local, Global2Local, Global2Local, Local2Global, Local2Global, Local2Global, toString
 
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
 

Field Detail

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.
Constructor Detail

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) )
Method Detail

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.