Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 4, 2016, 6:31:29 PM (8 years ago)
Author:
landauf
Message:

use only default constructor (with context, but no other arguments)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentationHS15/src/modules/hover/HoverFlag.cc

    r11041 r11042  
    4848    {
    4949        RegisterObject(HoverFlag);
    50         model_ = NULL;
    51         cs_ = NULL;
     50
     51        this->model_ = NULL;
     52        this->cs_ = NULL;
     53        this->collided_ = false;
     54
     55        this->enableCollisionCallback();
     56        this->setCollisionResponse(true);
     57        this->setCollisionType(Static);
    5258    }
    5359
    5460    /**
    5561    @brief
    56         Constructor that expects two coordinate-values in the range 0-9
     62        Initializes the flag.
    5763    @param xCoordinate
    5864        X-Coordinate of the flage, 0-9, origin is bottom left
     
    6066        Y-Coordinate of the flage, 0-9, origin is bottom left
    6167    */
    62     HoverFlag::HoverFlag(Context* context, int xCoordinate, int yCoordinate, int cellSize) : StaticEntity(context)
     68    void HoverFlag::init(int xCoordinate, int yCoordinate, int cellSize)
    6369    {
    64         RegisterObject(HoverFlag);
    65         enableCollisionCallback();
    66         model_ = NULL;
    67         cs_ = NULL;
    68 
    69         model_ = new Model(context);
     70        model_ = new Model(this->getContext());
    7071        model_->setMeshSource("ss_flag_eu.mesh");
    7172        model_->setScale3D(Vector3(5, 5, 5));
     
    7475        this->attach(model_);
    7576
    76         this->enableCollisionCallback();
    77         this->setCollisionResponse(true);
    78         this->setCollisionType(Static);
    79 
    80         cs_ = new BoxCollisionShape(context);
     77        cs_ = new BoxCollisionShape(this->getContext());
    8178        cs_->setHalfExtents(Vector3(5, 5, 5));
    8279        cs_->setPosition(Vector3(xCoordinate*cellSize*1.0f + cellSize/2,0.0f,yCoordinate*cellSize*1.0f + cellSize/2));
    8380
    8481        this->attachCollisionShape(cs_);
    85         this->collided_ = false;
    86 
    8782    }
    8883
Note: See TracChangeset for help on using the changeset viewer.