00001 /* $Id: DistRot.h,v 1.4 2002/11/05 14:31:15 anonymous Exp $ */ 00002 00003 #ifndef __DIST_ROT_H 00004 #define __DIST_ROT_H 00005 00006 #include <esg/geometry/includes.h> 00007 00008 #include <esg/Export> 00009 00010 /* 00011 * Class DistRot takes geometry and infomation about its transformation 00012 * in constructor. The distance() method takes static geometry and 00013 * returns their distance with next conditions: 00014 * 00015 * minimal distance < 0 => penetration 00016 * minimal distance > 0 => separation 00017 * 00018 * If distance is bigger then 'minimal distance' 00019 * then MAXFLOAT is returned, found distance is returned otherwise. 00020 * 00021 * Because convertion of two transformation matrices may change ratio scale, 00022 * this scale factor is get in constructor and applyied to computed distances 00023 * (distance is divided by this parapeter) 00024 */ 00025 00026 namespace esg { 00027 00028 class OGSCENE_EXPORT DistRot { 00029 protected: 00030 double _scaleRatio; 00031 00032 public: 00033 DistRot(double sr = 1.0) 00034 : _scaleRatio(sr) {} 00035 00036 virtual ~DistRot() {} 00037 00038 virtual double distance (Geometry& /* static geometry */, 00039 double /* minimal distance */, 00040 Vector3* /* approx. direction */) = 0; 00041 00042 /* 00043 * Output separation diraction is valid only for objects that are 00044 * penetrated and represents the approximately shortest way to 00045 * get them separated. 00046 */ 00047 virtual bool separation (Geometry& /* static geometry */, 00048 Vector3* /* approx. direction */) = 0; 00049 }; 00050 00051 }; // namespace 00052 00053 #endif // __DIST_ROT_H