fshake3d
0.0.1
FreeformDensity3DSurfaceEditor
|
00001 #if 0 00002 00003 #include "scene_PlaneSensor.hpp" 00004 00005 Planed sZPlane( Vec3d(0,0,-1), Point3d(0,0,0) ); 00006 00007 bool PlaneSensor::testDragBegin(const Rayd& ray, double& t) 00008 { 00009 return intersect(sZPlane, ray, t ); 00010 } 00011 00012 bool PlaneSensor::testDragUpdate(const Rayd& ray, double& t) 00013 { 00014 return intersect(sZPlane, ray, t ); 00015 } 00016 00017 void DragSensor::onEvent(Event& e) 00018 { 00019 switch(e.getType()) 00020 { 00021 case EVENT_BUTTONDOWN: 00022 { 00023 // make ray event and dispatch 00024 00025 Event rayEvent(e); 00026 rayEvent.setRay(); 00027 Rayd ray = e.getRay(); 00028 double t; 00029 if ( testDragBegin( ray, t ) ) 00030 { 00031 captureRay(); 00032 dragBegin( ray, t ); 00033 } 00034 } 00035 break; 00036 case EVENT_RAYCAPTUREUPDATE: 00037 { 00038 const Rayd& ray = e.getRay(); 00039 double t; 00040 if ( testDragUpdate(ray,t) ) 00041 { 00042 dragUpdate( ray, t ); 00043 } 00044 } 00045 break; 00046 case EVENT_RAYRELEASE: 00047 00048 break; 00049 } 00050 } 00051 00052 void PlaneSensor::setDragBegin(const Point3d& p) 00053 { 00054 mDragBegin = p; 00055 } 00056 00057 void PlaneSensor::setDragEnd(const Point3d& p) 00058 { 00059 mDragEnd = p;/ 00060 Vec3d delta = mDragEnd - mDragBegin; 00061 setDelta( Vec2d(delta[0],delta[1]) ); 00062 } 00063 00064 void PlaneSensor::setDelta(const Vec3d& d) 00065 { 00066 } 00067 00068 00069 #endif