Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10698 in orxonox.OLD for trunk/src/util/track/track.cc


Ignore:
Timestamp:
Jun 14, 2007, 5:33:43 PM (17 years ago)
Author:
snellen
Message:

merged adm, hud, vs-enhancements : beni's responsible for this commit. blame him!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/track/track.cc

    r10618 r10698  
    2929
    3030#include "debug.h"
     31#include "action_box.h"
    3132
    3233ObjectListDefinition(Track);
     
    6566  this->duration = 20;
    6667  this->endTime = 20;
    67   this->width = 10;
     68  this->width = 24;
     69  this->height = 18;
     70  this->depth = 200;
     71  this->stretch = 4;
    6872  this->curve = new BezierCurve();
    6973  this->trackNode = new PNode(PNode::getNullParent(), PNODE_ALL);
     
    7175  this->localTime = 0;
    7276  this->pause = false;
     77 
     78  this->actionBox = NULL;
    7379}
    7480
     
    94100     }
    95101     LOAD_PARAM_END_CYCLE(element);
     102
     103     LoadParam(root, "ActionBox", this, Track, addActionBox );
    96104}
    97105
     
    252260       {
    253261           Vector tmp = this->calcPos();
    254    
    255    
     262
     263
    256264           Vector dV = tmp - this->trackNode->getAbsCoor();
    257265           float dx = speed * dt;
    258266           float ratio = dx / dV.len();
    259    
     267
    260268           if( dt > 0.0f)
    261269           {
     
    264272           }
    265273           tmp = this->calcPos();
    266    
     274
    267275           Vector v(0.0, 1.0, 0.0);
    268276           Quaternion quat = Quaternion(this->calcDir(), v);
    269277           Quaternion q(-PI/2, v);
    270278           quat = quat * q;
    271    
     279
    272280           // move trackNode of the track
    273281           this->trackNode->shiftCoor(tmp - this->trackNode->getAbsCoor());
     
    331339    glPopMatrix();
    332340}
     341
     342/**
     343 * creates new action box and assignes it to this track
     344 * @param width_2 width/2 of near end
     345 * @param height_2 height/2 of near end
     346 * @param depth depth
     347 * @param stretch far end will be stretched with this factor
     348 */
     349void Track::addActionBox( float width_2, float height_2, float depth, float stretch )
     350{
     351  actionBox = new ActionBox( this, width_2, height_2, depth, stretch );
     352}
     353
     354
     355
Note: See TracChangeset for help on using the changeset viewer.