- if ( _display_mode == ARC ) {
- float xOffset = 256.0f;
- float yOffset = 200.0f;
-
- int firstQuadVert = _vertices->size();
- _texCoords->push_back(osg::Vec2f(0.5f, 0.25f));
- _vertices->push_back(osg::Vec2f(-xOffset, 0.0 + yOffset));
- _texCoords->push_back(osg::Vec2f(1.0f, 0.25f));
- _vertices->push_back(osg::Vec2f(xOffset, 0.0 + yOffset));
- _texCoords->push_back(osg::Vec2f(1.0f, 0.5f));
- _vertices->push_back(osg::Vec2f(xOffset, 256.0 + yOffset));
- _texCoords->push_back(osg::Vec2f(0.5f, 0.5f));
- _vertices->push_back(osg::Vec2f(-xOffset, 256.0 + yOffset));
- maskPSet->set(osg::PrimitiveSet::QUADS, firstQuadVert, 4);
-
- // The triangles aren't supposed to be textured, but there's
- // no need to set up a different Geometry, switch modes,
- // etc. I happen to know that there's a white pixel in the
- // texture at 1.0, 0.0 :)
- float centerY = tan(30 * SG_DEGREES_TO_RADIANS);
- _vertices->push_back(osg::Vec2f(0.0, 0.0));
- _vertices->push_back(osg::Vec2f(-256.0, 0.0));
- _vertices->push_back(osg::Vec2f(-256.0, 256.0 * centerY));
-
- _vertices->push_back(osg::Vec2f(0.0, 0.0));
- _vertices->push_back(osg::Vec2f(256.0, 0.0));
- _vertices->push_back(osg::Vec2f(256.0, 256.0 * centerY));
-
- _vertices->push_back(osg::Vec2f(-256, 0.0));
- _vertices->push_back(osg::Vec2f(256.0, 0.0));
- _vertices->push_back(osg::Vec2f(-256.0, -256.0));
-
- _vertices->push_back(osg::Vec2f(256, 0.0));
- _vertices->push_back(osg::Vec2f(256.0, -256.0));
- _vertices->push_back(osg::Vec2f(-256.0, -256.0));
-
- const osg::Vec2f whiteSpot(1.0f, 0.0f);
- for (int i = 0; i < 3 * 4; i++)
- _texCoords->push_back(whiteSpot);
-
- trimaskPSet->set(osg::PrimitiveSet::TRIANGLES, firstQuadVert + 4,
- 3 * 4);
+ if (_display_mode == ARC) {
+ // erase what is out of sight of antenna
+ /*
+ |\ /|
+ | \ / |
+ | \ / |
+ ---------
+ | |
+ | |
+ ---------
+ */
+ float xOffset = 256.0f;
+ float yOffset = 200.0f;
+
+ int firstQuadVert = _vertices->size();
+ _texCoords->push_back(osg::Vec2f(0.5f, 0.25f));
+ _vertices->push_back(osg::Vec2f(-xOffset, 0.0 + yOffset));
+ _texCoords->push_back(osg::Vec2f(1.0f, 0.25f));
+ _vertices->push_back(osg::Vec2f(xOffset, 0.0 + yOffset));
+ _texCoords->push_back(osg::Vec2f(1.0f, 0.5f));
+ _vertices->push_back(osg::Vec2f(xOffset, 256.0 + yOffset));
+ _texCoords->push_back(osg::Vec2f(0.5f, 0.5f));
+ _vertices->push_back(osg::Vec2f(-xOffset, 256.0 + yOffset));
+ maskPSet->set(osg::PrimitiveSet::QUADS, firstQuadVert, 4);
+ firstQuadVert += 4;
+
+ // The triangles aren't supposed to be textured, but there's
+ // no need to set up a different Geometry, switch modes,
+ // etc. I happen to know that there's a white pixel in the
+ // texture at 1.0, 0.0 :)
+ float centerY = tan(30 * SG_DEGREES_TO_RADIANS);
+ _vertices->push_back(osg::Vec2f(0.0, 0.0));
+ _vertices->push_back(osg::Vec2f(-256.0, 0.0));
+ _vertices->push_back(osg::Vec2f(-256.0, 256.0 * centerY));
+
+ _vertices->push_back(osg::Vec2f(0.0, 0.0));
+ _vertices->push_back(osg::Vec2f(256.0, 0.0));
+ _vertices->push_back(osg::Vec2f(256.0, 256.0 * centerY));
+
+ _vertices->push_back(osg::Vec2f(-256, 0.0));
+ _vertices->push_back(osg::Vec2f(256.0, 0.0));
+ _vertices->push_back(osg::Vec2f(-256.0, -256.0));
+
+ _vertices->push_back(osg::Vec2f(256, 0.0));
+ _vertices->push_back(osg::Vec2f(256.0, -256.0));
+ _vertices->push_back(osg::Vec2f(-256.0, -256.0));
+
+ const osg::Vec2f whiteSpot(1.0f, 0.0f);
+ for (int i = 0; i < 3 * 4; i++)
+ _texCoords->push_back(whiteSpot);
+
+ trimaskPSet->set(osg::PrimitiveSet::TRIANGLES, firstQuadVert, 3 * 4);
+
+ } else
+ {
+ maskPSet->set(osg::PrimitiveSet::QUADS, 0, 0);
+ trimaskPSet->set(osg::PrimitiveSet::TRIANGLES, 0, 0);
+ }