From 5a48bcf2a0b5e2998282ba28a7a1ac0582fc3f46 Mon Sep 17 00:00:00 2001 From: frohlich Date: Wed, 27 Dec 2006 10:47:10 +0000 Subject: [PATCH] Modified Files: src/FDM/flight.cxx src/FDM/flight.hxx src/FDM/groundcache.cxx: Maik Justus: Provide the material we roll on in the groundcache. --- src/FDM/flight.cxx | 14 ++++++++++++++ src/FDM/flight.hxx | 3 +++ src/FDM/groundcache.cxx | 1 + 3 files changed, 18 insertions(+) diff --git a/src/FDM/flight.cxx b/src/FDM/flight.cxx index 08aa8fae7..55d8545a5 100644 --- a/src/FDM/flight.cxx +++ b/src/FDM/flight.cxx @@ -883,6 +883,20 @@ FGInterface::get_agl_m(double t, const double pt[3], return ret; } +bool +FGInterface::get_agl_m(double t, const double pt[3], + double contact[3], double normal[3], double vel[3], + int *type, const SGMaterial **material, double *agl) +{ + SGVec3d _contact, _normal, _vel; + bool ret = ground_cache.get_agl(t, SGVec3d(pt), 2.0, _contact, _normal, + _vel, type, material, agl); + sgdCopyVec3(contact, _contact.data()); + sgdCopyVec3(normal, _normal.data()); + sgdCopyVec3(vel, _vel.data()); + return ret; +} + // Legacy interface just kept because of JSBSim bool FGInterface::get_agl_ft(double t, const double pt[3], diff --git a/src/FDM/flight.hxx b/src/FDM/flight.hxx index 09d40bd32..f5533625c 100644 --- a/src/FDM/flight.hxx +++ b/src/FDM/flight.hxx @@ -1128,6 +1128,9 @@ public: double contact[3], double normal[3], double vel[3], int *type, double *loadCapacity, double *frictionFactor, double *agl); + bool get_agl_m(double t, const double pt[3], + double contact[3], double normal[3], double vel[3], + int *type, const SGMaterial **material,double *agl); bool get_agl_ft(double t, const double pt[3], double contact[3], double normal[3], double vel[3], int *type, double *loadCapacity, diff --git a/src/FDM/groundcache.cxx b/src/FDM/groundcache.cxx index 3f1a396a0..3ffc28331 100644 --- a/src/FDM/groundcache.cxx +++ b/src/FDM/groundcache.cxx @@ -527,6 +527,7 @@ public: t.rotation = mGroundProperty.rot; t.rotation_pivot = mGroundProperty.pivot - mGroundCache->cache_center; t.type = mGroundProperty.type; + t.material=mGroundProperty.material; mGroundCache->triangles.push_back(t); } }