mGroundProperty.pivot = SGVec3d(0, 0, 0);
}
- void setSceneryCenter(const SGVec3d& cntr)
- {
- mLocalToGlobal.makeTranslate(cntr.osg());
- mGlobalToLocal.makeTranslate(-cntr.osg());
- }
-
void updateCullMode(osg::StateSet* stateSet)
{
if (!stateSet)
FGGroundCache::GroundProperty& gp = mGroundProperty;
// get some material information for use in the gear model
- gp.material = globals->get_matlib()->findMaterial(&node);
- if (gp.material) {
- gp.type = gp.material->get_solid() ? FGInterface::Solid : FGInterface::Water;
- return true;
- }
gp.type = FGInterface::Unknown;
osg::Referenced* base = node.getUserData();
if (!base)
bool oldBackfaceCulling = mBackfaceCulling;
updateCullMode(drawable->getStateSet());
+ FGGroundCache::GroundProperty& gp = mGroundProperty;
+ // get some material information for use in the gear model
+ gp.material = globals->get_matlib()->findMaterial(drawable->getStateSet());
+ if (gp.material)
+ gp.type = gp.material->get_solid() ? FGInterface::Solid : FGInterface::Water;
+
drawable->accept(mTriangleFunctor);
mBackfaceCulling = oldBackfaceCulling;
// Walk the scene graph and extract solid ground triangles and carrier data.
GroundCacheFillVisitor gcfv(this, down, pt, cacheRadius, wireCacheRadius);
- gcfv.setSceneryCenter(globals->get_scenery()->get_center());
globals->get_scenery()->get_scene_graph()->accept(gcfv);
// some stats