X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2Fgroundcache.hxx;h=145561a9c571589b47f1075e8d7be5735de6de2b;hb=49677f512b8edaaf22c76761dbbf9c0850c79aad;hp=14aeb171c1e34b8153dced6971e37d436f2b6022;hpb=db2d4a7a68bde08a2b80496d9842e78b7df55fe6;p=flightgear.git diff --git a/src/FDM/groundcache.hxx b/src/FDM/groundcache.hxx index 14aeb171c..145561a9c 100644 --- a/src/FDM/groundcache.hxx +++ b/src/FDM/groundcache.hxx @@ -23,9 +23,6 @@ #ifndef _GROUNDCACHE_HXX #define _GROUNDCACHE_HXX -#include -#include - #include #include #include @@ -33,6 +30,13 @@ #include #include +// #define GROUNDCACHE_DEBUG +#ifdef GROUNDCACHE_DEBUG +#include +#include +#include +#endif + class SGMaterial; namespace simgear { class BVHLineGeometry; @@ -62,6 +66,12 @@ public: const SGVec3d& get_down() const { return down; } + // The time offset that originates from a simtime different than zero + // at initialization time of the fdm. + double get_cache_time_offset() const + { return cache_time_offset; } + void set_cache_time_offset(double time_offset) + { cache_time_offset = time_offset; } bool get_body(double t, SGMatrixd& bodyToWorld, SGVec3d& linearVel, SGVec3d& angularVel, simgear::BVHNode::Id id); @@ -114,6 +124,8 @@ private: // The time reference for later call to intersection test routines. // Is required since we will have moving triangles in carriers. double cache_ref_time; + // The time the cache was initialized. + double cache_time_offset; // The wire to track. const simgear::BVHLineGeometry* _wire; @@ -125,6 +137,15 @@ private: bool found_ground; SGSharedPtr _localBvhTree; + +#ifdef GROUNDCACHE_DEBUG + SGTimeStamp _lookupTime; + unsigned _lookupCount; + SGTimeStamp _buildTime; + unsigned _buildCount; + + osg::ref_ptr _group; +#endif }; #endif