HapticSphere.h

Go to the documentation of this file.
00001 
00003 //    Copyright 2004, SenseGraphics AB
00004 //
00005 //    This file is part of H3D API.
00006 //
00007 //    H3D API is free software; you can redistribute it and/or modify
00008 //    it under the terms of the GNU General Public License as published by
00009 //    the Free Software Foundation; either version 2 of the License, or
00010 //    (at your option) any later version.
00011 //
00012 //    H3D API is distributed in the hope that it will be useful,
00013 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 //    GNU General Public License for more details.
00016 //
00017 //    You should have received a copy of the GNU General Public License
00018 //    along with H3D API; if not, write to the Free Software
00019 //    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 //
00021 //    A commercial license is also available. Please contact us at 
00022 //    www.sensegraphics.com for more information.
00023 //
00024 //
00028 //
00030 #ifndef __HAPTICSPHERE_H__
00031 #define __HAPTICSPHERE_H__
00032 
00033 #include "X3DGeometryNode.h"
00034 #include "H3DSurfaceNode.h"
00035 #include "HapticShape.h"
00036 #include "HLCustomObject.h"
00037 
00038 namespace H3D {
00039 
00041   class H3DAPI_API HapticSphere: public HapticShape, public HLCustomObject  {
00042   public:
00048     HapticSphere( H3DFloat _radius,
00049                   bool _solid,
00050                   X3DGeometryNode *_geometry,
00051                   H3DSurfaceNode *_surface,
00052                   const Matrix4f &_transform ):
00053       HapticShape( _geometry, _surface, _transform ),
00054       radius( _radius ),
00055       solid( _solid ) {}
00056 #ifdef HAVE_OPENHAPTICS
00071     virtual bool intersectSurface( const Vec3f &start_point, 
00072                                    const Vec3f &end_point,
00073                                    Vec3f &intersection_point, 
00074                                    Vec3f &intersection_normal,
00075                                    HLenum &face );
00076 
00086     virtual bool closestFeature( const Vec3f &query_point, 
00087                                  const Vec3f &target_point,
00088                                  HLgeom *geom,
00089                                  Vec3f &closest_point );    
00090 
00092     virtual void hlRender( HLHapticsDevice *hd );
00093 #endif
00094 
00095     H3DFloat radius;
00096 
00099     bool solid;
00100   };
00101 }
00102 
00103 #endif

Generated on Thu Aug 24 12:38:33 2006 for H3D API by  doxygen 1.4.5