Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6005 in orxonox.OLD for trunk/src/world_entities/space_ships


Ignore:
Timestamp:
Dec 10, 2005, 12:21:31 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: automatic LOD-loading

Location:
trunk/src/world_entities/space_ships
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/space_ships/helicopter.cc

    r6002 r6005  
    1818
    1919#include "helicopter.h"
    20 
    21 #include "objModel.h"
    22 #include "resource_manager.h"
    2320
    2421#include "weapons/weapon_manager.h"
     
    111108  PRINTF(4)("SPACESHIP INIT\n");
    112109
    113   this->loadModel("models/ships/helicopter_high.obj", 1.0, 0);
    114   this->loadModel("models/ships/helicopter_medium.obj", 1.0, 1);
    115   this->loadModel("models/ships/helicopter_low.obj", 1.0, 2);
     110  this->loadModel("models/ships/helicopter_#.obj", 1.0);
    116111
    117112  EventHandler::getInstance()->grabEvents(true);
     
    350345}
    351346
     347
     348void Helicopter::draw() const
     349{
     350  this->drawLODsafe();
     351
     352  this->getWeaponManager()->draw();
     353}
     354
     355
    352356/**
    353357 * weapon manipulation by the player
  • trunk/src/world_entities/space_ships/helicopter.h

    r6002 r6005  
    3232    virtual void collidesWith(WorldEntity* entity, const Vector& location);
    3333    virtual void tick(float time);
     34    virtual void draw() const;
    3435
    3536    virtual void process(const Event &event);
  • trunk/src/world_entities/space_ships/space_ship.cc

    r6002 r6005  
    240240void SpaceShip::draw () const
    241241{
    242   glMatrixMode(GL_MODELVIEW);
    243   glPushMatrix();
    244   /* translate */
    245   glTranslatef (this->getAbsCoor ().x,
    246                 this->getAbsCoor ().y,
    247                 this->getAbsCoor ().z);
    248   /* rotate */
    249   Vector tmpRot = this->getAbsDir().getSpacialAxis();
    250   glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
    251   this->getModel()->draw();
    252   glPopMatrix();
     242  this->drawLODsafe();
    253243
    254244  this->getWeaponManager()->draw();
Note: See TracChangeset for help on using the changeset viewer.