00001 //=========================================================================== 00002 /* 00003 This file is part of the CHAI 3D visualization and haptics libraries. 00004 Copyright (C) 2003-2009 by CHAI 3D. All rights reserved. 00005 00006 This library is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License("GPL") version 2 00008 as published by the Free Software Foundation. 00009 00010 For using the CHAI 3D libraries with software that can not be combined 00011 with the GNU GPL, and for taking advantage of the additional benefits 00012 of our support services, please contact CHAI 3D about acquiring a 00013 Professional Edition License. 00014 00015 \author <http://www.chai3d.org> 00016 \author Francois Conti 00017 \version 2.0.0 $Rev: 251 $ 00018 */ 00019 //=========================================================================== 00020 00021 //--------------------------------------------------------------------------- 00022 #ifndef CInteractionBasicsH 00023 #define CInteractionBasicsH 00024 //--------------------------------------------------------------------------- 00025 #include "math/CVector3d.h" 00026 #include "math/CMatrix3d.h" 00027 #include "graphics/CVertex.h" 00028 #include "graphics/CMaterial.h" 00029 #include <vector> 00030 //--------------------------------------------------------------------------- 00031 using std::vector; 00032 class cGenericObject; 00033 //--------------------------------------------------------------------------- 00034 00035 //=========================================================================== 00043 //=========================================================================== 00044 00045 //=========================================================================== 00054 //=========================================================================== 00055 struct cInteractionEvent 00056 { 00058 cGenericObject* m_object; 00059 00061 bool m_isInside; 00062 00064 cVector3d m_localPos; 00065 00067 cVector3d m_localForce; 00068 00070 cVector3d m_localSurfacePos; 00071 00073 void clear() 00074 { 00075 m_object = NULL; 00076 m_isInside = false; 00077 m_localPos.zero(); 00078 m_localForce.zero(); 00079 m_localSurfacePos.zero(); 00080 } 00081 }; 00082 00083 //=========================================================================== 00092 //=========================================================================== 00093 struct cInteractionSettings 00094 { 00096 bool m_checkVisibleObjectsOnly; 00097 00099 bool m_checkHapticObjectsOnly; 00100 }; 00101 00102 00103 //=========================================================================== 00111 //=========================================================================== 00112 class cInteractionRecorder 00113 { 00114 public: 00115 00116 //----------------------------------------------------------------------- 00117 // CONSTRUCTOR & DESTRUCTOR: 00118 //----------------------------------------------------------------------- 00119 00121 cInteractionRecorder() { clear(); } 00122 00124 virtual ~cInteractionRecorder() {}; 00125 00126 00127 //----------------------------------------------------------------------- 00128 // METHODS: 00129 //----------------------------------------------------------------------- 00130 00132 void clear() 00133 { 00134 m_interactions.clear(); 00135 } 00136 00137 00138 //----------------------------------------------------------------------- 00139 // MEMBERS: 00140 //----------------------------------------------------------------------- 00141 00143 vector<cInteractionEvent> m_interactions; 00144 }; 00145 00146 00147 //--------------------------------------------------------------------------- 00148 #endif 00149 //--------------------------------------------------------------------------- 00150