osg::Matrix SGGeod::makeSimulationFrameRelative() const
{
SGQuatd hlOr = SGQuatd::fromLonLat(*this);
- return osg::Matrix(hlOr.osg());
+ return osg::Matrix(toOsg(hlOr));
}
osg::Matrix SGGeod::makeSimulationFrame() const
osg::Matrix result(makeSimulationFrameRelative());
SGVec3d coord;
SGGeodesy::SGGeodToCart(*this, coord);
- result.setTrans(coord.osg());
+ result.setTrans(toOsg(coord));
return result;
}
osg::Matrix result(makeZUpFrameRelative());
SGVec3d coord;
SGGeodesy::SGGeodToCart(*this, coord);
- result.setTrans(coord.osg());
+ result.setTrans(toOsg(coord));
return result;
}
/// make sure it has at least 4 elements
explicit SGQuat(const T* d)
{ data()[0] = d[0]; data()[1] = d[1]; data()[2] = d[2]; data()[3] = d[3]; }
-#ifndef NO_OPENSCENEGRAPH_INTERFACE
- explicit SGQuat(const osg::Quat& d)
- { data()[0] = d[0]; data()[1] = d[1]; data()[2] = d[2]; data()[3] = d[3]; }
-#endif
/// Return a unit quaternion
static SGQuat unit(void)
T (&data(void))[4]
{ return _data; }
-#ifndef NO_OPENSCENEGRAPH_INTERFACE
- osg::Quat osg() const
- { return osg::Quat(data()[0], data()[1], data()[2], data()[3]); }
-#endif
-
/// Inplace addition
SGQuat& operator+=(const SGQuat& v)
{ data()[0]+=v(0);data()[1]+=v(1);data()[2]+=v(2);data()[3]+=v(3);return *this; }
template<typename S>
explicit SGVec2(const SGVec2<S>& d)
{ data()[0] = d[0]; data()[1] = d[1]; }
-#ifndef NO_OPENSCENEGRAPH_INTERFACE
- explicit SGVec2(const osg::Vec2f& d)
- { data()[0] = d[0]; data()[1] = d[1]; }
- explicit SGVec2(const osg::Vec2d& d)
- { data()[0] = d[0]; data()[1] = d[1]; }
-#endif
/// Access by index, the index is unchecked
const T& operator()(unsigned i) const
T (&data(void))[2]
{ return _data; }
-#ifndef NO_OPENSCENEGRAPH_INTERFACE
- osg::Vec2d osg() const
- { return osg::Vec2d(data()[0], data()[1]); }
-#endif
-
/// Inplace addition
SGVec2& operator+=(const SGVec2& v)
{ data()[0] += v(0); data()[1] += v(1); return *this; }
{ data()[0] = d[0]; data()[1] = d[1]; data()[2] = d[2]; }
explicit SGVec3(const SGVec2<T>& v2, const T& v3 = 0)
{ data()[0] = v2[0]; data()[1] = v2[1]; data()[2] = v3; }
-#ifndef NO_OPENSCENEGRAPH_INTERFACE
- explicit SGVec3(const osg::Vec3f& d)
- { data()[0] = d[0]; data()[1] = d[1]; data()[2] = d[2]; }
- explicit SGVec3(const osg::Vec3d& d)
- { data()[0] = d[0]; data()[1] = d[1]; data()[2] = d[2]; }
-#endif
/// Access by index, the index is unchecked
const T& operator()(unsigned i) const
T (&data(void))[3]
{ return _data; }
-#ifndef NO_OPENSCENEGRAPH_INTERFACE
- osg::Vec3d osg() const
- { return osg::Vec3d(data()[0], data()[1], data()[2]); }
-#endif
-
/// Inplace addition
SGVec3& operator+=(const SGVec3& v)
{ data()[0] += v(0); data()[1] += v(1); data()[2] += v(2); return *this; }
{ data()[0] = d[0]; data()[1] = d[1]; data()[2] = d[2]; data()[3] = d[3]; }
explicit SGVec4(const SGVec3<T>& v3, const T& v4 = 0)
{ data()[0] = v3[0]; data()[1] = v3[1]; data()[2] = v3[2]; data()[3] = v4; }
-#ifndef NO_OPENSCENEGRAPH_INTERFACE
- explicit SGVec4(const osg::Vec4f& d)
- { data()[0] = d[0]; data()[1] = d[1]; data()[2] = d[2]; data()[3] = d[3]; }
- explicit SGVec4(const osg::Vec4d& d)
- { data()[0] = d[0]; data()[1] = d[1]; data()[2] = d[2]; data()[3] = d[3]; }
-#endif
/// Access by index, the index is unchecked
const T& operator()(unsigned i) const
T (&data(void))[4]
{ return _data; }
-#ifndef NO_OPENSCENEGRAPH_INTERFACE
- osg::Vec4d osg() const
- { return osg::Vec4d(data()[0], data()[1], data()[2], data()[3]); }
-#endif
-
/// Inplace addition
SGVec4& operator+=(const SGVec4& v)
{ data()[0]+=v(0);data()[1]+=v(1);data()[2]+=v(2);data()[3]+=v(3);return *this; }
{
if (prop->nChildren() == 0) {
if (prop->getType() == props::VEC4D) {
- return osg::Vec4f(prop->getValue<SGVec4d>().osg());
+ return osg::Vec4f(toOsg(prop->getValue<SGVec4d>()));
} else if (prop->getType() == props::VEC3D) {
- return osg::Vec4f(prop->getValue<SGVec3d>().osg(), 1.0f);
+ return osg::Vec4f(toOsg(prop->getValue<SGVec3d>()), 1.0f);
} else {
SG_LOG(SG_INPUT, SG_ALERT,
"invalid color property " << prop->getName() << " "
}
TexEnv* env = new TexEnv(mode);
if (colorProp)
- env->setColor(colorProp->getValue<SGVec4d>().osg());
+ env->setColor(toOsg(colorProp->getValue<SGVec4d>()));
return env;
}
uniform->set(valProp->getValue<float>());
break;
case Uniform::FLOAT_VEC3:
- uniform->set(Vec3f(valProp->getValue<SGVec3d>().osg()));
+ uniform->set(toOsg(valProp->getValue<SGVec3d>()));
break;
case Uniform::FLOAT_VEC4:
- uniform->set(Vec4f(valProp->getValue<SGVec4d>().osg()));
+ uniform->set(toOsg(valProp->getValue<SGVec4d>()));
break;
case Uniform::SAMPLER_1D:
case Uniform::SAMPLER_2D:
// Trick to get the ends in the right order.
// Use the x axis in the original coordinate system. Choose the
// most negative x-axis as the one pointing forward
- SGVec3f tv1(_matrix.preMult(v1));
- SGVec3f tv2(_matrix.preMult(v2));
+ SGVec3f tv1(toSG(_matrix.preMult(v1)));
+ SGVec3f tv2(toSG(_matrix.preMult(v2)));
if (tv1[0] > tv2[0])
_lineSegments.push_back(SGLineSegmentf(tv1, tv2));
else
osg::Vec4 rgbaVec4()
{
- return rgba().osg();
+ return toOsg(rgba());
}
SGVec4f &initialRgba() {
SGRotateTransform::computeBound() const
{
osg::BoundingSphere bs = osg::Group::computeBound();
- osg::BoundingSphere centerbs(_center.osg(), bs.radius());
+ osg::BoundingSphere centerbs(toOsg(_center), bs.radius());
centerbs.expandBy(bs);
return centerbs;
}
fr += 3;
else
return false;
- rot.setCenter(SGVec3d(center));
+ rot.setCenter(toSG(center));
}
if (fr[0].matchWord("axis")) {
++fr;
fr += 3;
else
return false;
- rot.setCenter(SGVec3d(axis));
+ rot.setCenter(toSG(axis));
}
if (fr[0].matchWord("angle")) {
++fr;
fr += 3;
else
return false;
- scale.setCenter(SGVec3d(center));
+ scale.setCenter(toSG(center));
}
if (fr[0].matchWord("scaleFactor")) {
++fr;
fr += 3;
else
return false;
- scale.setScaleFactor(SGVec3d(scaleFactor));
+ scale.setScaleFactor(toSG(scaleFactor));
}
return true;
}
osg::NodeVisitor* nv) const
{
if (_referenceFrame == RELATIVE_RF) {
- matrix.preMultTranslate((_value*_axis).osg());
+ matrix.preMultTranslate(toOsg(_value*_axis));
} else {
- matrix.setTrans((_value*_axis).osg());
+ matrix.setTrans(toOsg(_value*_axis));
}
return true;
}
osg::NodeVisitor* nv) const
{
if (_referenceFrame == RELATIVE_RF) {
- matrix.postMultTranslate((-_value*_axis).osg());
+ matrix.postMultTranslate(toOsg(-_value*_axis));
} else {
- matrix.setTrans((-_value*_axis).osg());
+ matrix.setTrans(toOsg(-_value*_axis));
}
return true;
}
SGTranslateTransform::computeBound() const
{
osg::BoundingSphere bs = osg::Group::computeBound();
- bs._center += _axis.osg()*_value;
+ bs._center += toOsg(_axis)*_value;
return bs;
}
fr += 3;
else
return false;
- trans.setAxis(SGVec3d(axis));
+ trans.setAxis(toSG(axis));
}
if (fr[0].matchWord("value")) {
++fr;
if (!nv)
return 1;
- double scale_factor = (_center.osg() - nv->getEyePoint()).length();
+ double scale_factor = (toOsg(_center) - nv->getEyePoint()).length();
if (_table == 0) {
scale_factor = _factor * scale_factor + _offset;
} else {
SGQuatd q
= SGQuatd::fromLonLatDeg(modelRoot->getFloatValue("/position/longitude-deg",0),
modelRoot->getFloatValue("/position/latitude-deg",0));
- osg::Matrix om(q.osg());
+ osg::Matrix om(toOsg(q));
osg::Vec3 v(0,0,9.81);
gravity = om.preMult(v);
const osg::Vec3& zUpWind = Particles::getWindVector();
if (displace * displace > 10000.0 * 10000.0) {
// Make new frame for particle system, coincident with
// the emitter frame, but oriented with local Z.
- SGGeod geod = SGGeod::fromCart(SGVec3d(emitOrigin));
+ SGGeod geod = SGGeod::fromCart(toSG(emitOrigin));
Matrix newParticleMat = geod.makeZUpFrame();
Matrix changeParticleFrame
= particleMat * Matrix::inverse(newParticleMat);
{
// The cartesian position
SGVec3d position = SGVec3d::fromGeod(_position);
- _transform->setPosition(position.osg());
+ _transform->setPosition(toOsg(position));
// The orientation, composed from the horizontal local orientation and the
// orientation wrt the horizontal local frame
// the y axis 180 degrees.
orient *= SGQuatd::fromRealImag(0, SGVec3d(0, 1, 0));
- _transform->setAttitude(orient.osg());
+ _transform->setAttitude(toOsg(orient));
}
bool
// FIXME: need an update or callback ...
// generate the six highlight map images (light direction = [1, 1, -1])
osg::ref_ptr<osgUtil::HighlightMapGenerator> mapgen;
- mapgen = new osgUtil::HighlightMapGenerator(_lastLightDirection.osg(),
- _lastLightColor.osg(), 5);
+ mapgen = new osgUtil::HighlightMapGenerator(toOsg(_lastLightDirection),
+ toOsg(_lastLightColor), 5);
mapgen->generateMap();
// assign the six images to the texture object
if (!combine)
return;
// An approximation for light reflected back by chrome.
- osg::Vec4 globalColor = (updateVisitor->getAmbientLight().osg() * .4f
- + updateVisitor->getDiffuseLight().osg());
+ osg::Vec4 globalColor = toOsg(updateVisitor->getAmbientLight() * .4f
+ + updateVisitor->getDiffuseLight());
globalColor.a() = 1.0f;
combine->setConstantColor(globalColor);
}
itr != end;
++itr) {
Vec4f projPos
- = Vec4f(_cloudsprites[itr->idx].position.osg(), 1.0f) * mvp;
+ = Vec4f(toOsg(_cloudsprites[itr->idx].position), 1.0f) * mvp;
itr->depth = projPos.z() / projPos.w();
}
// Already sorted?
// repaint the cloud layer colors
bool SGCloudLayer::repaint( const SGVec3f& fog_color ) {
- osg::Vec4f combineColor(fog_color.osg(), cloud_alpha);
+ osg::Vec4f combineColor(toOsg(fog_color), cloud_alpha);
osg::TexEnvCombine* combiner
= dynamic_cast<osg::TexEnvCombine*>(layer_root->getStateSet()
->getTextureAttribute(1, osg::StateAttribute::TEXENV));
double alt, double dt )
{
// combine p and asl (meters) to get translation offset
- osg::Vec3 asl_offset(up.osg());
+ osg::Vec3 asl_offset(toOsg(up));
asl_offset.normalize();
if ( alt <= layer_asl ) {
asl_offset *= layer_asl;
// cout << "asl_offset = " << asl_offset[0] << "," << asl_offset[1]
// << "," << asl_offset[2] << endl;
- asl_offset += p.osg();
+ asl_offset += toOsg(p);
// cout << " asl_offset = " << asl_offset[0] << "," << asl_offset[1]
// << "," << asl_offset[2] << endl;
// First time or very large distance
SGVec3<double> cart;
SGGeodesy::SGGeodToCart(SGGeod::fromRad(lon, lat), cart);
- T.makeTranslate(cart.osg());
+ T.makeTranslate(toOsg(cart));
LON.makeRotate(lon, osg::Vec3(0, 0, 1));
LAT.makeRotate(90.0 * SGD_DEGREES_TO_RADIANS - lat, osg::Vec3(0, 1, 0));
SGVec3<double> cart;
SGGeodesy::SGGeodToCart(SGGeod::fromRad(cld_pos.getLongitudeRad(), cld_pos.getLatitudeRad()), cart);
- T.makeTranslate(cart.osg());
+ T.makeTranslate(toOsg(cart));
LON.makeRotate(cld_pos.getLongitudeRad(), osg::Vec3(0, 0, 1));
LAT.makeRotate(90.0 * SGD_DEGREES_TO_RADIANS - cld_pos.getLatitudeRad(), osg::Vec3(0, 1, 0));
osg::ref_ptr<osg::PositionAttitudeTransform> transform = new osg::PositionAttitudeTransform;
- transform->setPosition(pos.osg());
+ transform->setPosition(toOsg(pos));
transform->addChild(geode.get());
field_group[x][y]->addChild(transform.get(), true);
const float upperVisFactor = 1.0 - vis_factor * (0.7 + 0.3 * cvf/45000);
const float middleVisFactor = 1.0 - vis_factor * (0.1 + 0.85 * cvf/45000);
- (*dome_cl)[0] = sky_color.osg();
+ (*dome_cl)[0] = toOsg(sky_color);
simgear::VectorArrayAdapter<Vec3Array> colors(*dome_cl, numBands, 1);
const double saif = sun_angle/SG_PI;
static const SGVec3f blueShift(0.8, 1.0, 1.2);
for (int i = 0; i < halfBands+1; i++) {
SGVec3f diff = mult(skyFogDelta, blueShift);
diff *= (0.8 + saif - ((halfBands-i)/10));
- colors(2, i) = (sky_color - upperVisFactor * diff).osg();
- colors(3, i) = (sky_color - middleVisFactor * diff + middle_amt).osg();
- colors(4, i) = (fog_color + outer_amt).osg();
+ colors(2, i) = toOsg(sky_color - upperVisFactor * diff);
+ colors(3, i) = toOsg(sky_color - middleVisFactor * diff + middle_amt);
+ colors(4, i) = toOsg(fog_color + outer_amt);
colors(0, i) = simgear::math::lerp(toOsg(sky_color), colors(2, i), .3942);
colors(1, i) = simgear::math::lerp(toOsg(sky_color), colors(2, i), .7885);
for (int j = 0; j < numRings - 1; ++j)
numBands);
for ( int i = 0; i < numBands; i++ )
- colors(numRings - 1, i) = fog_color.osg();
+ colors(numRings - 1, i) = toOsg(fog_color);
dome_cl->dirty();
return true;
}
// Translate to view position
// Point3D zero_elev = current_view.get_cur_zero_elev();
// xglTranslatef( zero_elev.x(), zero_elev.y(), zero_elev.z() );
- T.makeTranslate( p.osg() );
+ T.makeTranslate( toOsg(p) );
// printf(" Translated to %.2f %.2f %.2f\n",
// zero_elev.x, zero_elev.y, zero_elev.z );
disable();
}
SGCloudField::updateFog((double)effective_visibility,
- osg::Vec4f(sc.fog_color.osg(), 1.0f));
+ osg::Vec4f(toOsg(sc.fog_color), 1.0f));
return true;
}
dome->reposition( st.zero_elev, st.alt, st.lon, st.lat, st.spin );
osg::Matrix m = osg::Matrix::rotate(angleRad, osg::Vec3(0, 0, -1));
- m.postMultTranslate(st.view_pos.osg());
+ m.postMultTranslate(toOsg(st.view_pos));
_ephTransform->setMatrix(m);
double sun_ra = eph.getSunRightAscension();
SGVec4f fogColor = updateVisitor->getFogColor();
fog = static_cast<osg::Fog*>(runwayLightSS
->getAttribute(StateAttribute::FOG));
- fog->setColor(fogColor.osg());
+ fog->setColor(toOsg(fogColor));
fog->setDensity(updateVisitor->getRunwayFogExp2Density());
fog = static_cast<osg::Fog*>(taxiLightSS
->getAttribute(StateAttribute::FOG));
- fog->setColor(fogColor.osg());
+ fog->setColor(toOsg(fogColor));
fog->setDensity(updateVisitor->getTaxiFogExp2Density());
fog = static_cast<osg::Fog*>(groundLightSS
->getAttribute(StateAttribute::FOG));
- fog->setColor(fogColor.osg());
+ fog->setColor(toOsg(fogColor));
fog->setDensity(updateVisitor->getGroundLightsFogExp2Density());
}
for (int j = 0; j < latPoints; j++) {
for (int i = 0; i < lonPoints; ++i) {
- vlArray(j, i) = rel[j][i].osg();
- nlArray(j, i) = normals[j][i].osg();
- tlArray(j, i) = texsArray(j, i).toSGVec2f().osg();
+ vlArray(j, i) = toOsg(rel[j][i]);
+ nlArray(j, i) = toOsg(normals[j][i]);
+ tlArray(j, i) = toOsg(texsArray(j, i).toSGVec2f());
}
}
osg::MatrixTransform* transform = new osg::MatrixTransform;
transform->setName("Ocean");
- transform->setMatrix(osg::Matrix::rotate(hlOr.osg())*
- osg::Matrix::translate(cartCenter.osg()));
+ transform->setMatrix(osg::Matrix::rotate(toOsg(hlOr))*
+ osg::Matrix::translate(toOsg(cartCenter)));
transform->addChild(geode);
return transform;
triangle_ref triangle = triangles[i];
if (indexMap[triangle[0]] == invalid) {
indexMap[triangle[0]] = vertices->size();
- vertices->push_back(getVertex(triangle[0]).vertex.osg());
- normals->push_back(getVertex(triangle[0]).normal.osg());
- texCoords->push_back(getVertex(triangle[0]).texCoord.osg());
+ vertices->push_back(toOsg(getVertex(triangle[0]).vertex));
+ normals->push_back(toOsg(getVertex(triangle[0]).normal));
+ texCoords->push_back(toOsg(getVertex(triangle[0]).texCoord));
}
deFacade.push_back(indexMap[triangle[0]]);
if (indexMap[triangle[1]] == invalid) {
indexMap[triangle[1]] = vertices->size();
- vertices->push_back(getVertex(triangle[1]).vertex.osg());
- normals->push_back(getVertex(triangle[1]).normal.osg());
- texCoords->push_back(getVertex(triangle[1]).texCoord.osg());
+ vertices->push_back(toOsg(getVertex(triangle[1]).vertex));
+ normals->push_back(toOsg(getVertex(triangle[1]).normal));
+ texCoords->push_back(toOsg(getVertex(triangle[1]).texCoord));
}
deFacade.push_back(indexMap[triangle[1]]);
if (indexMap[triangle[2]] == invalid) {
indexMap[triangle[2]] = vertices->size();
- vertices->push_back(getVertex(triangle[2]).vertex.osg());
- normals->push_back(getVertex(triangle[2]).normal.osg());
- texCoords->push_back(getVertex(triangle[2]).texCoord.osg());
+ vertices->push_back(toOsg(getVertex(triangle[2]).vertex));
+ normals->push_back(toOsg(getVertex(triangle[2]).normal));
+ texCoords->push_back(toOsg(getVertex(triangle[2]).texCoord));
}
deFacade.push_back(indexMap[triangle[2]]);
}
// Retrieve the eye point in local coords
osg::Matrix m;
m.invert(renderInfo.getState()->getModelViewMatrix());
- SGVec3f eyePoint(m.preMult(osg::Vec3(0, 0, 0)));
+ SGVec3f eyePoint(toSG(m.preMult(osg::Vec3(0, 0, 0))));
// paint the points
for (unsigned i = 0; i < _lights.size(); ++i)
{
osg::BoundingBox bb;
for (unsigned i = 0; i < _lights.size(); ++i)
- bb.expandBy(_lights[i].position.osg());
+ bb.expandBy(toOsg(_lights[i].position));
// blow up to avoid being victim to small feature culling ...
bb.expandBy(bb._min - osg::Vec3(1, 1, 1));
void addTreeToLeafGeode(Geode* geode, const SGVec3f& p)
{
- const Vec3& pos = p.osg();
+ Vec3 pos = toOsg(p);
unsigned int numDrawables = geode->getNumDrawables();
Geometry* geom
= static_cast<Geometry*>(geode->getDrawable(numDrawables - 1));
{
Vec3 operator() (const TreeBin::Tree& tree) const
{
- return tree.position.osg();
+ return toOsg(tree.position);
}
};
TreeTransformer(Matrix& mat_) : mat(mat_) {}
TreeBin::Tree operator()(const TreeBin::Tree& tree) const
{
- const Vec3& pos = tree.position.osg();
- return TreeBin::Tree(SGVec3f(pos * mat));
+ Vec3 pos = toOsg(tree.position);
+ return TreeBin::Tree(toSG(pos * mat));
}
Matrix mat;
};
// location, and then apply the rotation matrix created
// above, with an additional random heading rotation if appropriate.
osg::Matrix transformMat;
- transformMat = osg::Matrix::translate(obj.position.osg());
+ transformMat = osg::Matrix::translate(toOsg(obj.position));
if (obj.model->get_heading_type() == SGMatModel::HEADING_RANDOM) {
// Rotate the object around the z axis.
double hdg = mt_rand(&seed) * M_PI * 2;
// The toplevel transform for that tile.
osg::MatrixTransform* transform = new osg::MatrixTransform;
transform->setName(path);
- transform->setMatrix(osg::Matrix::rotate(hlOr.osg())*
- osg::Matrix::translate(center.osg()));
+ transform->setMatrix(osg::Matrix::rotate(toOsg(hlOr))*
+ osg::Matrix::translate(toOsg(center)));
transform->addChild(terrainGroup);
if (lightGroup->getNumChildren() > 0) {
osg::LOD* lightLOD = new osg::LOD;
osg::Vec3Array* vertices = new osg::Vec3Array;
osg::Vec4Array* colors = new osg::Vec4Array;
- vertices->push_back(light.position.osg());
- colors->push_back(light.color.osg());
+ vertices->push_back(toOsg(light.position));
+ colors->push_back(toOsg(light.color));
osg::Geometry* geometry = new osg::Geometry;
geometry->setVertexArray(vertices);
SGVec3f perp1 = perpendicular(normal);
SGVec3f perp2 = cross(normal, perp1);
SGVec3f position = light.position;
- vertices->push_back(position.osg());
- vertices->push_back((position + perp1).osg());
- vertices->push_back((position + perp2).osg());
- colors->push_back(visibleColor.osg());
- colors->push_back(invisibleColor.osg());
- colors->push_back(invisibleColor.osg());
+ vertices->push_back(toOsg(position));
+ vertices->push_back(toOsg(position + perp1));
+ vertices->push_back(toOsg(position + perp2));
+ colors->push_back(toOsg(visibleColor));
+ colors->push_back(toOsg(invisibleColor));
+ colors->push_back(toOsg(invisibleColor));
osg::Geometry* geometry = new osg::Geometry;
geometry->setVertexArray(vertices);
osg::Vec4Array* colors = new osg::Vec4Array;
for (unsigned i = 0; i < lights.getNumLights(); i += inc) {
- vertices->push_back(lights.getLight(i).position.osg());
+ vertices->push_back(toOsg(lights.getLight(i).position));
SGVec4f color = lights.getLight(i).color;
color[3] = SGMiscf::max(0, SGMiscf::min(1, color[3] + alphaOff));
- colors->push_back(color.osg());
+ colors->push_back(toOsg(color));
}
osg::Geometry* geometry = new osg::Geometry;
SGVec3f perp1 = perpendicular(normal);
SGVec3f perp2 = cross(normal, perp1);
SGVec3f position = lights.getLight(i).position;
- vertices->push_back(position.osg());
- vertices->push_back((position + perp1).osg());
- vertices->push_back((position + perp2).osg());
- colors->push_back(visibleColor.osg());
- colors->push_back(invisibleColor.osg());
- colors->push_back(invisibleColor.osg());
+ vertices->push_back(toOsg(position));
+ vertices->push_back(toOsg(position + perp1));
+ vertices->push_back(toOsg(position + perp2));
+ colors->push_back(toOsg(visibleColor));
+ colors->push_back(toOsg(invisibleColor));
+ colors->push_back(toOsg(invisibleColor));
}
osg::Geometry* geometry = new osg::Geometry;
const SGQuatd& globalViewOrientation)
{
mGlobalGeodEyePos = SGGeod::fromCart(globalEyePos);
- _currentEyePos = globalEyePos.osg();
+ _currentEyePos = toOsg(globalEyePos);
mGlobalEyePos = globalEyePos;
mGlobalViewOr = globalViewOrientation;
mGlobalHorizLocalOr = SGQuatd::fromLonLat(mGlobalGeodEyePos);