00001
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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