StarRegionVectorInteractor::StarRegionVectorInteractor (const std::string & name,
      const osg::Vec3f & p,
      const osg::Vec3f & n,
      const osg::Vec3f & l,
      float s, int d,
      float vx, float vy, float vz)
      : StarRegionInteractor (name, p, n, l, s, d)
{
   if (debug)
   {
      fprintf (stderr,"StarRegionVectorInteractor::StarRegionVectorInteractor\n");
      fprintf (stderr,"\tname=[%s]\n", name.c_str());
      fprintf (stderr,"\tposition=[%f %f %f]\n", p[0], p[1], p[2]);
      fprintf (stderr,"\tnormal=[%f %f %f]\n", n[0], n[1], n[2]);
      fprintf (stderr,"\tvec=[%f %f %f]\n", vx, vy, vz);
   }

   osg::Matrixf transMat;

   currentVector.set (vx, vy, vz);                // Region-Koordinaten

   // initialize current axis
   //currentAxis.set(0.0, 0.0, 1.0); // zAxis;

   arrowRotDCS = new osg::MatrixTransform();
   arrowGroup = loadArrow();

   textTransDCS = new osg::MatrixTransform();
   transMat.makeTranslate (0.0, -3.5, 0.35);
   textTransDCS->setMatrix (transMat);

   textBillboardDCS = new osg::MatrixTransform();
   std::cerr << "StarRegionVectorInteractor::<init> fixme: billboard and labels" << std::endl;

//    textBillboardDCS->setTravData(PFTRAV_APP,(void *)this);
//    textBillboardDCS->setTravMask(PFTRAV_APP,0xFFFF,PFTRAV_SELF,PF_SET);
//    textBillboardDCS->setTravFuncs(PFTRAV_APP, preAppCallback, NULL);

   //labels = createLabels(vx, vy, vz);

   worldDCS->addChild (regionDCS.get());
   regionDCS->addChild (arrowRotDCS.get());
   arrowRotDCS->addChild (arrowGroup.get());
   arrowRotDCS->addChild (textTransDCS.get());
   textTransDCS->addChild (textBillboardDCS.get());
//   textBillboardDCS->addChild(labels.get());

   // draw local coordinate system
   createLocalAxis();

   setValue (vx, vy, vz);

}
Beispiel #2
0
Card::Card(std::vector<std::string> inSvCat, std::vector<std::string> inEnCat, std::string inSvH, std::string inSvT, std::string inEnH, std::string inEnT, glm::vec3 inPos, glm::vec2 inVel, std::string textPath, SDL_Renderer* r)
: pos(inPos)
, velocity(inVel)
, lifeTime(clock())
, path(textPath)
, isReading(false)
, isTrans(false)
{
    infoIndex = infoIndexGenerator++;
    loadingText(r, inSvH, inSvT, inEnH, inEnT, inSvCat, inEnCat);
    if (shadow == NULL) {
        shadow = loadShadow(r);
    }
    if (arrow == NULL) {
        arrow = loadArrow(r);
    }
}