AnimaL |
Tutorial |
Documentation |
00001 // 00002 // C++ Implementation: AnimalEngineNode 00003 // 00004 // Description: 00005 // 00006 // 00007 // Author: My Name <me@myaddress>, (C) 2004 00008 // 00009 // Copyright: See COPYING file that comes with this distribution 00010 // 00011 // 00012 #include <animal/engine/AnimalEngineNode.h> 00013 00014 namespace X3DTK 00015 { 00016 00017 namespace X3D 00018 { 00019 00020 template<class E> 00021 AnimalEngineNode<E>::AnimalEngineNode() 00022 : EngineNode() 00023 {} 00024 00025 template<class E> 00026 AnimalEngineNode<E>::~AnimalEngineNode() 00027 {} 00028 00033 template<class E> 00034 void AnimalEngineNode<E>::draw() 00035 { 00036 Engine::draw(); 00037 } 00038 00039 // /*! 00040 // \fn X3DTK::X3D::AnimalEngineNode::updateBoundingBo() 00041 // Update the bounding box of the engin node. 00042 // */ 00043 // template<class E> 00044 // void AnimalEngineNode<E>::updateBoundingBox() 00045 // { 00046 // float minX, minY, minZ, maxX, maxY, maxZ; 00047 // Engine::getBoundingBox(minX, minY, minZ, maxX, maxY, maxZ); 00048 // //std::cout<<"AnimalEngineNode<E>::updateBoundingBox, values = "<< minX<<", "<<minY<<", "<<minZ<<", "<<maxX<<", "<<maxY<<", "<<maxZ<<std::endl; 00049 // setBBoxCenter(SFVec3f((minX+maxX)/2.0, (minY+maxY)/2.0, (minZ+maxZ)/2.0)); 00050 // //std::cout<<"AnimalEngineNode<E>::updateBoundingBox, center= = "<< SFVec3f((minX+maxX)/2.0, (minY+maxY)/2.0, (minZ+maxZ)/2.0) <<std::endl; 00051 // setBBoxSize(SFVec3f(-minX+maxX, -minY+maxY, -minZ+maxZ)); 00052 // //std::cout<<"AnimalEngineNode<E>::updateBoundingBox, size= = "<< SFVec3f(-minX+maxX, -minY+maxY, -minZ+maxZ) <<std::endl; 00053 // 00054 // } 00055 00056 // /*! 00057 // \fn X3DTK::X3D::AnimalEngineNode::drawBoundingBox() 00058 // Draw the bounding box of the engine. 00059 // */ 00060 // template<class E> 00061 // void AnimalEngineNode<E>::drawBoundingBox() 00062 // { 00063 // Engine::drawBoundingBox(); 00064 // } 00065 00066 // /*! 00067 // \fn X3DTK::X3D::AnimalEngineNode::getBoundingBox( float& xmin, float& ymin, float& zmin, float& xmax, float& ymax, float& zmax ) 00068 // Compute the bounding box of the engine. 00069 // */ 00070 // template<class E> 00071 // void AnimalEngineNode<E>::getBoundingBox( float& minX, float& minY, float& minZ, float& maxX, float& maxY, float& maxZ ) 00072 // { 00073 // Engine::getBoundingBox(minX, minY, minZ, maxX, maxY, maxZ); 00074 // setBBoxCenter(SFVec3f((minX+maxX)/2.0, (minY+maxY)/2.0, (minZ+maxZ)/2.0)); 00075 // setBBoxSize(SFVec3f(-minX+maxX, -minY+maxY, -minZ+maxZ)); 00076 // } 00077 00082 template<class E> 00083 void AnimalEngineNode<E>::init() 00084 { 00085 Engine::init(); 00086 } 00087 00092 template<class E> 00093 void AnimalEngineNode<E>::reset() 00094 { 00095 Engine::reset(); 00096 } 00097 00102 template<class E> 00103 void AnimalEngineNode<E>::postReset() 00104 { 00105 Engine::postReset(); 00106 } 00107 00112 template<class E> 00113 void AnimalEngineNode<E>::keyPressedEvent( animal::KeyEvent* e ) 00114 { 00115 Engine::keyPressEvent( e ); 00116 } 00117 00119 template<class E> 00120 void AnimalEngineNode<E>::mouseDoubleClickEvent(animal::MouseEvent * e) 00121 { 00122 Engine::mouseDoubleClickEvent(e); 00123 } 00125 template<class E> 00126 void AnimalEngineNode<E>::mouseMoveEvent(animal::MouseEvent *e) 00127 { 00128 Engine::mouseMoveEvent(e); 00129 } 00131 template<class E> 00132 void AnimalEngineNode<E>::mousePressEvent(animal::MouseEvent *e) 00133 { 00134 Engine::mousePressEvent(e); 00135 } 00137 template<class E> 00138 void AnimalEngineNode<E>::mouseReleaseEvent(animal::MouseEvent *e) 00139 { 00140 Engine::mouseReleaseEvent(e); 00141 } 00143 template<class E> 00144 animal::ConstrainedItem* AnimalEngineNode<E>::pickPoint( float* orig, float* dir, float thresh ) 00145 { 00146 return Engine::pickPoint(orig,dir,thresh); 00147 } 00148 00152 template<class E> 00153 void AnimalEngineNode<E>::animate(float dt) 00154 { 00155 Engine::move(dt); 00156 } 00160 template<class E> 00161 void AnimalEngineNode<E>::postAnimate(float dt) 00162 { 00163 Engine::postMove(dt); 00164 } 00165 00166 }; 00167 00168 }; 00169 00170