const SGMaterial* material = _material;
_haveHit = false;
- _center = SGVec3d(inverseMatrix.preMult(_center.osg()));
- _down = SGVec3d(osg::Matrix::transform3x3(_down.osg(), inverseMatrix));
+ _center = toSG(inverseMatrix.preMult(toOsg(_center)));
+ _down = toSG(osg::Matrix::transform3x3(toOsg(_down), inverseMatrix));
if (velocity) {
SGVec3d staticCenter(_center);
_sceneryHit = ori.transform(_sceneryHit);
_sceneryHit += dt*velocity->linear;
}
- _sceneryHit = SGVec3d(matrix.preMult(_sceneryHit.osg()));
+ _sceneryHit = toSG(matrix.preMult(toOsg(_sceneryHit)));
} else {
_material = material;
_haveHit = haveHit;
SGLineSegmentd downSeg(_center, _center + _maxDown*_down);
double maxDist = bound._radius + _radius;
- return distSqr(downSeg, SGVec3d(bound._center)) <= maxDist*maxDist;
+ SGVec3d boundCenter(toVec3d(toSG(bound._center)));
+ return distSqr(downSeg, boundCenter) <= maxDist*maxDist;
}
SGSharedPtr<simgear::BVHNode> getBVHNode() const
osg::Light* light = lightSource->getLight();
FGLight *l = static_cast<FGLight*>(globals->get_subsystem("lighting"));
- light->setAmbient(l->scene_ambient().osg());
- light->setDiffuse(l->scene_diffuse().osg());
- light->setSpecular(l->scene_specular().osg());
- SGVec4f position(l->sun_vec()[0], l->sun_vec()[1], l->sun_vec()[2], 0);
- light->setPosition(position.osg());
- SGVec3f direction(l->sun_vec()[0], l->sun_vec()[1], l->sun_vec()[2]);
- light->setDirection(direction.osg());
+ light->setAmbient(toOsg(l->scene_ambient()));
+ light->setDiffuse(toOsg(l->scene_diffuse()));
+ light->setSpecular(toOsg(l->scene_specular()));
+ osg::Vec4f position(l->sun_vec()[0], l->sun_vec()[1], l->sun_vec()[2], 0);
+ light->setPosition(position);
+ osg::Vec3f direction(l->sun_vec()[0], l->sun_vec()[1], l->sun_vec()[2]);
+ light->setDirection(direction);
light->setSpotExponent(0);
light->setSpotCutoff(180);
light->setConstantAttenuation(1);
#if 0
FGLight *l = static_cast<FGLight*>(globals->get_subsystem("lighting"));
- lightModel->setAmbientIntensity(l->scene_ambient().osg());
+ lightModel->setAmbientIntensity(toOsg(l->scene_ambient());
#else
lightModel->setAmbientIntensity(osg::Vec4(0, 0, 0, 1));
#endif
SGUpdateVisitor* updateVisitor = static_cast<SGUpdateVisitor*>(nv);
osg::Fog* fog = static_cast<osg::Fog*>(sa);
fog->setMode(osg::Fog::EXP2);
- fog->setColor(updateVisitor->getFogColor().osg());
+ fog->setColor(toOsg(updateVisitor->getFogColor()));
fog->setDensity(updateVisitor->getFogExp2Density());
}
};
if ( fgGetBool("/sim/rendering/textures") ) {
SGVec4f clearColor(l->adj_fog_color());
- camera->setClearColor(clearColor.osg());
+ camera->setClearColor(toOsg(clearColor));
}
} else {
SGVec4f clearColor(l->sky_color());
- camera->setClearColor(clearColor.osg());
+ camera->setClearColor(toOsg(clearColor));
}
// update fog params if visibility has changed
if (!pickCallback)
continue;
SGSceneryPick sceneryPick;
- sceneryPick.info.local = SGVec3d(hit->getLocalIntersectPoint());
- sceneryPick.info.wgs84 = SGVec3d(hit->getWorldIntersectPoint());
+ sceneryPick.info.local = toSG(hit->getLocalIntersectPoint());
+ sceneryPick.info.wgs84 = toSG(hit->getWorldIntersectPoint());
sceneryPick.callback = pickCallback;
pickList.push_back(sceneryPick);
}
osgUtil::IntersectVisitor intersectVisitor;
intersectVisitor.setTraversalMask(SG_NODEMASK_TERRAIN_BIT);
osg::ref_ptr<osg::LineSegment> lineSegment;
- lineSegment = new osg::LineSegment(start.osg(), end.osg());
+ lineSegment = new osg::LineSegment(toOsg(start), toOsg(end));
intersectVisitor.addLineSegment(lineSegment.get());
get_scene_graph()->accept(intersectVisitor);
bool hits = false;
osgUtil::IntersectVisitor intersectVisitor;
intersectVisitor.setTraversalMask(SG_NODEMASK_TERRAIN_BIT);
osg::ref_ptr<osg::LineSegment> lineSegment;
- lineSegment = new osg::LineSegment(start.osg(), end.osg());
+ lineSegment = new osg::LineSegment(toOsg(start), toOsg(end));
intersectVisitor.addLineSegment(lineSegment.get());
get_scene_graph()->accept(intersectVisitor);
bool hits = false;
if (!get_elevation_m(SGGeod::fromGeodM(position, SG_MAX_ELEVATION_M), elev, 0, 0))
return false;
SGVec3f p = SGVec3f::fromGeod(SGGeod::fromGeodM(position, elev));
- simgear::CheckSceneryVisitor csnv(getPagerSingleton(), p.osg(), range_m);
+ simgear::CheckSceneryVisitor csnv(getPagerSingleton(), toOsg(p), range_m);
// currently the PagedLODs will not be loaded by the DatabasePager
// while the splashscreen is there, so CheckSceneryVisitor force-loads
// missing objects in the main thread