1
0
Fork 0

Modified Files:

src/FDM/groundcache.cxx src/FDM/groundcache.hxx: Store the material
	that was used to get the croase agl level and return that material
	in case we need to make use of that croase value.
This commit is contained in:
frohlich 2007-01-02 09:50:35 +00:00
parent f63c96bf0e
commit 93cb29608a
2 changed files with 13 additions and 3 deletions

View file

@ -364,6 +364,7 @@ public:
gp.type = gp.material->get_solid() ? FGInterface::Solid : FGInterface::Water;
return true;
}
gp.type = FGInterface::Unknown;
osg::Referenced* base = node.getUserData();
if (!base)
return true;
@ -543,8 +544,11 @@ public:
isectpoint.osg() = isectpoint.osg()*mLocalToGlobal;
isectpoint += mGroundCache->cache_center;
double this_radius = length(isectpoint);
if (mGroundCache->ground_radius < this_radius)
if (mGroundCache->ground_radius < this_radius) {
mGroundCache->ground_radius = this_radius;
mGroundCache->_type = mGroundProperty.type;
mGroundCache->_material = mGroundProperty.material;
}
}
}
@ -840,7 +844,9 @@ FGGroundCache::get_agl(double t, const SGVec3d& dpt, double max_altoff,
// The altitude is the distance of the requested point from the
// contact point.
*agl = dot(down, contact - dpt);
*type = FGInterface::Unknown;
*type = _type;
if (material)
*material = _material;
return ret;
}

View file

@ -122,6 +122,10 @@ private:
// Approximate ground radius.
// In case the aircraft is too high above ground.
double ground_radius;
// Ground type
int _type;
// the simgear material reference, contains friction coeficients ...
const SGMaterial* _material;
// The time reference for later call to intersection test routines.
// Is required since we will have moving triangles in carriers.
double cache_ref_time;