00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00027
00029 #ifndef __COORDINATEDEFORMER_H__
00030 #define __COORDINATEDEFORMER_H__
00031
00032 #include "H3DCoordinateDeformerNode.h"
00033 #include "H3DFunctionNode.h"
00034 #include "SFFloat.h"
00035 #include "MFBool.h"
00036
00037 namespace H3D {
00038
00053 class H3DAPI_API CoordinateDeformer : public H3DCoordinateDeformerNode {
00054 public:
00055
00056 typedef TypedSFNode< H3DFunctionNode > SFFunctionNode;
00057
00059 CoordinateDeformer( Inst< SFFunctionNode > _distanceToDepth = 0,
00060 Inst< SFFloat > _plasticity = 0 ):
00061 distanceToDepth( _distanceToDepth ),
00062 plasticity( _plasticity ),
00063 touched_last_time( false ) {
00064
00065 type_name = "CoordinateDeformer";
00066 database.initFields( this );
00067
00068 plasticity->setValue( 0 );
00069 }
00070
00073 virtual void deformPoints( const vector< bool > &is_touched,
00074 const vector< Vec3f > &touch_point,
00075 const vector< Vec3f > &touch_normal,
00076 const vector< Vec3f > &touch_force,
00077 const vector< Vec3f > &penetration_points,
00078 const vector< Vec3f > &orig_points,
00079 const vector< Vec3f > &resting_points,
00080 const vector< Vec3f > &deformed__points,
00081 vector< Vec3f > &new_resting_points,
00082 vector< Vec3f > &new_deformed_points );
00083
00091 auto_ptr< SFFunctionNode > distanceToDepth;
00092
00100 auto_ptr< SFFloat > plasticity;
00101
00103 static H3DNodeDatabase database;
00104
00105 protected:
00106 bool touched_last_time;
00107 };
00108 }
00109
00110 #endif