From 8627dd16694651db8f2916e4910c59b017acd234 Mon Sep 17 00:00:00 2001 From: frohlich Date: Tue, 7 Nov 2006 06:09:36 +0000 Subject: [PATCH] Modified Files: src/FDM/groundcache.cxx: Tim Moore: fix for groundcache problems. --- src/FDM/groundcache.cxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/FDM/groundcache.cxx b/src/FDM/groundcache.cxx index 2a9cde89c..8c9af341a 100644 --- a/src/FDM/groundcache.cxx +++ b/src/FDM/groundcache.cxx @@ -370,17 +370,25 @@ public: virtual void apply(osg::Transform& transform) { + if (!enterNode(transform)) + return; + bool oldBackfaceCulling = mBackfaceCulling; + bool oldSphIsec = sphIsec; + FGGroundCache::GroundProperty oldGp = mGroundProperty; /// transform the caches center to local coords osg::Matrix oldLocalToGlobal = mLocalToGlobal; transform.computeLocalToWorldMatrix(mLocalToGlobal, this); // walk the children - apply((osg::Group&)transform); + traverse(transform); // Restore that one mLocalToGlobal = oldLocalToGlobal; + sphIsec = oldSphIsec; + mBackfaceCulling = oldBackfaceCulling; + mGroundProperty = oldGp; } - + void addTriangle(const osg::Vec3& v1, const osg::Vec3& v2, const osg::Vec3& v3) {