Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 26, 2005, 2:03:33 PM (19 years ago)
Author:
bensch
Message:

orxonox/branches/physics: lights are pNodes not world-entities

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/physics/src/subprojects/particles/framework.cc

    r4297 r4298  
    4848bool Framework::draw(float dt)
    4949{
    50  
    51 
    5250  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
    5351  glLoadIdentity(); // Reset the view
     
    9492        if (mouse1Down)
    9593          {
    96             int mX = event.button.x;
    97             int mY = event.button.y;
    98             int wH = GraphicsEngine::getInstance()->getResolutionY();
    99             int wW = GraphicsEngine::getInstance()->getResolutionX();
    100             Vector tmpV (mX, mY, sqrt ( (float) abs(wH * wH/4 - (wW/2-mX) * (wW/2-mX) - (wH/2-mY) * (wH/2-mY)) ));
    101             //      PRINTF(0)("tmpV: %f, %f, %f\n", tmpV.x, tmpV.y, tmpV.z);
    102             p2 = tmpV-M;
    103             p2.y = -p2.y;
    104             rotAxis = p1.cross(p2);
    105             //  PRINTF(0)("rotAxis: %f, %f, %f\n", rotAxis.x, rotAxis.y, rotAxis.z);
    106 
    107             // in case that there is no rotation-axis defined
    108             if (rotAxis.x != 0 || rotAxis.y != 0 || rotAxis.z != 0)
     94            /*
     95              int mX = event.button.x;
     96              int mY = event.button.y;
     97              int wH = GraphicsEngine::getInstance()->getResolutionY();
     98              int wW = GraphicsEngine::getInstance()->getResolutionX();
     99              Vector tmpV (mX, mY, sqrt ( (float) abs(wH * wH/4 - (wW/2-mX) * (wW/2-mX) - (wH/2-mY) * (wH/2-mY)) ));
     100              //            PRINTF(0)("tmpV: %f, %f, %f\n", tmpV.x, tmpV.y, tmpV.z);
     101              p2 = tmpV-M;
     102              p2.y = -p2.y;
     103              rotAxis = p1.cross(p2);
     104              //  PRINTF(0)("rotAxis: %f, %f, %f\n", rotAxis.x, rotAxis.y, rotAxis.z);
     105             
     106              // in case that there is no rotation-axis defined
     107              if (rotAxis.x != 0 || rotAxis.y != 0 || rotAxis.z != 0)
    109108              {
    110                 rotAxis.normalize();
    111                 //              PRINTF(0)("rotAxis: %f, %f, %f\n", rotAxis.x, rotAxis.y, rotAxis.z, rotAngle);
    112                                
    113                 rotAngle = angleRad (p1, p2);
    114                 rotQ = Quaternion (rotAngle, rotAxis);
    115                 rotQ = rotQ * rotQlast;
    116                 rotQ.matrix (matQ);
    117                 //      dir = rotQ.apply(dir);
    118                 //      dir.normalize();
    119                 //      PRINTF(0)("rotAxis: %f, %f, %f, %f\n", dir.x, dir.y, dir.z, rotAngle);
     109              rotAxis.normalize();
     110              //                PRINTF(0)("rotAxis: %f, %f, %f\n", rotAxis.x, rotAxis.y, rotAxis.z, rotAngle);
     111             
     112              rotAngle = angleRad (p1, p2);
     113              rotQ = Quaternion (rotAngle, rotAxis);
     114              rotQ = rotQ * rotQlast;
     115              rotQ.matrix (matQ);
     116              //        dir = rotQ.apply(dir);
     117              //      dir.normalize();
     118              //        PRINTF(0)("rotAxis: %f, %f, %f, %f\n", dir.x, dir.y, dir.z, rotAngle);
    120119              }
    121             rotQlast = rotQ;
    122             p1 = p2;
     120              rotQlast = rotQ;
     121              p1 = p2;
     122            */
    123123
    124124          }
     
    172172          {
    173173          case SDLK_x:
    174 
     174           
    175175            break;
    176176          case SDLK_c:
Note: See TracChangeset for help on using the changeset viewer.