Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10785


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

Placing Walls works

Location:
code/branches/hoverHS15
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/hoverHS15/data/levels/Hover.oxw

    r10760 r10785  
    2929    ambientlight = "0.8, 0.8, 0.8"
    3030    skybox       = "Orxonox/Starbox"
     31    gravity      = "0, -35, 0"
    3132  >
    3233 
     
    3536 
    3637
    37   <StaticEntity position="200,0,0" collisionType="static">
     38  <StaticEntity position="0,0,0" collisionType="static">
    3839    <attached>
    3940      <Model position="500, 0, 0" yaw="0" pitch="0" roll="0" scale3D="500, 30, 2" mesh="cube_red.mesh" />
     
    5657    </attached>
    5758    <collisionShapes>
    58       <BoxCollisionShape yaw="0" pitch="0" roll="0" position="0,0,0" halfExtents="1, 1, 1" />
     59      <BoxCollisionShape yaw="0" pitch="0" roll="0" position="0,0,0" halfExtents="10000, 1, 10000" />
    5960    </collisionShapes>
    6061  </StaticEntity>
  • code/branches/hoverHS15/src/modules/hover/Hover.cc

    r10760 r10785  
    5959        {
    6060            firstTick = false;
    61             new HoverWall(origin_->getContext(), 1, 2);
    62             new HoverWall(origin_->getContext(), 2, 6);
     61            new HoverWall(origin_->getContext(), 1, 2, 1);
     62            new HoverWall(origin_->getContext(), 2, 6, 1);
    6363        }     
    6464
  • 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_);
  • code/branches/hoverHS15/src/modules/hover/HoverWall.h

    r10751 r10785  
    4949        public:
    5050            HoverWall(Context* context);           
    51             HoverWall(Context* context, int x, int y);
     51            HoverWall(Context* context, int x, int y, int orientation);
    5252            virtual ~HoverWall();
    5353            virtual void tick(float dt);
Note: See TracChangeset for help on using the changeset viewer.