Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10640 in orxonox.OLD


Ignore:
Timestamp:
Apr 22, 2007, 9:30:42 PM (17 years ago)
Author:
nicolasc
Message:

visual version of the action box, currently in the track.{cc,h}

Location:
branches/vs-enhencements/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/vs-enhencements/src/lib/math/quaternion.h

    r9656 r10640  
    5050
    5151    /** @param q: the Quaternion to compare with this one. @returns true if the Quaternions are the same, false otherwise */
    52   inline bool operator== (const Quaternion& q) const { return (unlikely(this->v==q.v&&this->w==q.w))?true:false; };
     52    inline bool operator== (const Quaternion& q) const { return (unlikely(this->v==q.v&&this->w==q.w))?true:false; };
    5353    /** @param q: the Quaternion to compare with this one. @returns true if the Quaternions are the same, false otherwise */
    54   inline bool operator!= (const Quaternion& q) const { return (unlikely(this->v!=q.v||this->w!=q.w))?true:false; };
     54    inline bool operator!= (const Quaternion& q) const { return (unlikely(this->v!=q.v||this->w!=q.w))?true:false; };
    5555    /** @param f: a real value @return a Quaternion containing the quotient */
    5656    inline Quaternion operator/ (const float& f) const { return (unlikely(f==0.0)) ? Quaternion() : Quaternion(this->v/f, this->w/f); };
  • branches/vs-enhencements/src/util/track/track.cc

    r10618 r10640  
    6565  this->duration = 20;
    6666  this->endTime = 20;
    67   this->width = 10;
     67  this->width = 24;
     68  this->height = 18;
     69  this->depth = 200;
     70  this->stretch = 4;
    6871  this->curve = new BezierCurve();
    6972  this->trackNode = new PNode(PNode::getNullParent(), PNODE_ALL);
     
    331334    glPopMatrix();
    332335}
     336
     337void Track::drawBox() const
     338{
     339    glMatrixMode(GL_MODELVIEW);
     340    glPushMatrix();
     341
     342    glPushAttrib(GL_ENABLE_BIT);
     343
     344    glDisable(GL_LIGHTING);
     345    glDisable(GL_TEXTURE_2D);
     346    glDisable(GL_BLEND);
     347    glLineWidth(2.0);
     348
     349    glTranslatef (trackNode->getAbsCoor ().x,
     350                  trackNode->getAbsCoor ().y,
     351                  trackNode->getAbsCoor ().z);
     352    Vector tmpRot = trackNode->getAbsDir().getSpacialAxis();
     353    glRotatef (trackNode->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
     354
     355
     356    glColor3f(1.0, 1.0, 0.0);
     357    glBegin(GL_LINE_STRIP);
     358      glVertex3f(0, height, width);
     359      glVertex3f(0, -height, width);
     360      glVertex3f(0, -height, -width);
     361      glVertex3f(0, height, -width);
     362      glVertex3f(0, height, width);
     363    glEnd();
     364
     365    glBegin(GL_LINE_STRIP);
     366      glVertex3f(depth, height * stretch, width * stretch);
     367      glVertex3f(depth, -height * stretch, width * stretch);
     368      glVertex3f(depth, -height * stretch, -width * stretch);
     369      glVertex3f(depth, height * stretch, -width * stretch);
     370      glVertex3f(depth, height * stretch, width * stretch);
     371    glEnd();
     372
     373    glBegin(GL_LINE_STRIP);
     374      glVertex3f(depth, height * stretch, width * stretch);
     375      glVertex3f(0, height, width);
     376      glVertex3f(0, -height, width);
     377      glVertex3f(depth, -height * stretch, width * stretch);
     378    glEnd();
     379
     380    glBegin(GL_LINE_STRIP);
     381      glVertex3f(depth, height * stretch, -width * stretch);
     382      glVertex3f(0, height, -width);
     383      glVertex3f(0, -height, -width);
     384      glVertex3f(depth, -height * stretch, -width * stretch);
     385    glEnd();
     386
     387    glPopMatrix();
     388}
  • branches/vs-enhencements/src/util/track/track.h

    r10498 r10640  
    3737
    3838   void drawGraph(float dt = 0.01) const;
     39   void drawBox() const;
    3940
    4041   //float                 startingTime;         //!< The time at which this Track begins.
     
    4344   float                 endTime;              //!< The time at which this Track ends.
    4445   float                 width;                //!< Th width of the Path. This tells the Player(s), how far he(they) can go to the left/right.
     46   float                 height;
     47   float                 depth;
     48   float                 stretch;
    4549
    4650   int                   nodeCount;            //!< The count of points this Track has.
  • branches/vs-enhencements/src/world_entities/space_ships/space_ship.cc

    r10618 r10640  
    246246
    247247
    248  this->loadModel("models/spaceships/human_spaceship_fighter.obj", .25);
     248  this->loadModel("models/spaceships/fighter_redesign9.obj");
    249249  //this->setVisibiliy(false);
    250250
     
    494494  if( this->entityTrack != NULL && this->isDrawTrack())
    495495    this->entityTrack->drawGraph();
     496  this->entityTrack->drawBox();
    496497
    497498  WorldEntity::draw();
Note: See TracChangeset for help on using the changeset viewer.