Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 7, 2018, 11:42:26 AM (6 years ago)
Author:
ottka
Message:

implement module

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/OrxoKart_HS18/src/modules/orxokart/OrxoKartTile.cc

    r12062 r12089  
    8383            Wall on the right side (1) or on top (2) of this square, 0-1       
    8484    */
    85     void OrxoKartTile::init(int x, int y, int cellSize, int cellHeight, int orientation)
     85    void OrxoKartTile::init(int x, int z, int s, int type)
    8686    {
     87        model_ = new Model(this->getContext());
     88        if (type == 1) {
     89           model_->setMeshSource("OrxoKartStreckenabschnitt.mesh");
     90        }
     91        else if (type == 2 ) {
     92            model_->setMeshSource("OrxoKartStreckenabschnittZiel.mesh");
     93        }
     94        model_->setScale3D(Vector3(s*1.0f, 8.0f, s*1.0f));
     95        model_->setPosition(Vector3(x*1.0f, 0.0f, z*1.0f));
     96
     97        this->attach(model_);
     98
     99        cs_ = new BoxCollisionShape(this->getContext());
     100        cs_->setHalfExtents(Vector3(s/2.0f, 1.0f, s/2.0f));
     101        cs_->setPosition(Vector3(x*1.0f, -1.0f, z*1.0f));
     102
     103        this->attachCollisionShape(cs_);
     104
     105        /*
     106
    87107        int xSize_, zSize_, xPos_, zPos_;
    88108
     
    113133
    114134        this->attachCollisionShape(cs_);
     135        */
    115136    }
    116137}
Note: See TracChangeset for help on using the changeset viewer.