TerminalObject.cpp

00001 #include "TerminalObject.h"
00002 
00003 TerminalObject::TerminalObject (RawObject * raw_obj): GraphicalObject (raw_obj)
00004 {
00005         // nothing to do
00006 }
00007 
00008 TerminalObject::~TerminalObject ()
00009 {
00010         // do nothing
00011 }
00012 
00013 void TerminalObject::Draw (int time, Camera * camera, Camera * monitor, bool show_bounding_volume, int culling_mode, bool level_of_detail)
00014 {
00015         Position pos;
00016         bool rotation;
00017         int culling_result;
00018 
00019         // return if position is not defined for the current time
00020         if (!(position->IsDefined (time))) return;
00021 
00022         // retrieve actual position
00023         pos = position->GetPosition (time);
00024 
00025         // check if we have to rotate
00026         rotation = position->HasStaticRotation ();
00027 
00028 
00029         // translate and rotate according to the actual position
00030         ApplyTransformation (pos, rotation);
00031 
00032         // cull the object against the viewing frustum
00033         culling_result = CullObject (camera, monitor, culling_mode, show_bounding_volume);
00034 
00035         // draw the object if it does not lie completely outside
00036         if (culling_result != C_OUTSIDE)
00037         {raw_object->Draw ();}
00038 
00039         // undo rotation and translation
00040         UndoTransformation (pos, rotation);
00041 }
00042 
00043 void TerminalObject::ComputeBoundingRadius ()
00044 {
00045         bounding_radius = raw_object->GetBoundingRadius ();
00046 }
00047 
00048 void TerminalObject::ComputeBoundingBox ()
00049 {
00050         bounding_box =  raw_object->GetBoundingBox ();
00051 }
00052 
00053 void TerminalObject::PrintToConsole ()
00054 {
00055         Position pos = position->GetPosition (0);
00056         printf ("TerminalObject: {%g, %g, %g, %g, %g, %g}\n", pos.x, pos.y, pos.z, pos.roll, pos.pitch, pos.yaw);
00057 }

Generated on Sun Jul 2 13:20:39 2006 for Demo by  doxygen 1.4.6-NO