Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 9, 2015, 2:14:47 PM (9 years ago)
Author:
meierman
Message:

Placing Walls works

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/hoverHS15/src/modules/hover/HoverWall.cc

    r10760 r10785  
    5454    }
    5555
    56     HoverWall::HoverWall(Context* context, int x, int y) : StaticEntity(context)
     56    HoverWall::HoverWall(Context* context, int x, int y, int orientation) : StaticEntity(context)
    5757    {
    5858        RegisterObject(HoverWall);
    5959
     60        int xSize_, zSize_, xPos_, zPos_;
     61
     62        if(orientation == 1){
     63            xSize_ = 50;
     64            zSize_ = 2;
     65            xPos_ = x*100;
     66            zPos_ = y*100-50;
     67        }
     68        else{
     69            xSize_ = 2;
     70            zSize_ = 50;
     71            xPos_ = x*100-50;
     72            zPos_ = y*100;
     73        }
     74
     75
    6076        model_ = new Model(context);
    6177        model_->setMeshSource("cube.mesh");
    62         model_->setScale3D(Vector3(100, 30, 2));
    63         model_->setPosition(Vector3(x*100-50,0,y*100-50));
     78        model_->setScale3D(Vector3(xSize_, 30, zSize_));
     79        model_->setPosition(Vector3(xPos_,0,zPos_));
    6480
    6581        this->attach(model_);
     
    7086
    7187        cs_ = new BoxCollisionShape(context);
    72         cs_->setHalfExtents(Vector3(100, 30, 2));
    73         cs_->setPosition(Vector3(x*100-50,0,y*100-50));
     88        cs_->setHalfExtents(Vector3(xSize_, 30, zSize_));
     89        cs_->setPosition(Vector3(xPos_,0,zPos_));
    7490
    7591        this->attachCollisionShape(cs_);
Note: See TracChangeset for help on using the changeset viewer.