Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 2, 2015, 6:01:56 PM (9 years ago)
Author:
fvultier
Message:

2 problems fixed: The collidesAgainst function in the hovership get now properly called. The Hoverhalls have a collisionShape that works.

File:
1 edited

Legend:

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

    r10751 r10760  
    5050    {
    5151        RegisterObject(HoverWall);
    52         model_ = new Model(context);
    53         cs_ = new BoxCollisionShape(context);
    54         model_->setMeshSource("cube.mesh");
    55         model_->setScale3D(Vector3(100, 30, 2));
    56         model_->setPosition(Vector3(100,0,100));
    57         cs_->setPosition(Vector3(100,0,100));
    58         cs_->setHalfExtents(Vector3(100, 30, 2));
    59 
    60 
    61 
     52        model_ = NULL;
     53        cs_ = NULL;
    6254    }
    6355
     
    6557    {
    6658        RegisterObject(HoverWall);
     59
    6760        model_ = new Model(context);
     61        model_->setMeshSource("cube.mesh");
     62        model_->setScale3D(Vector3(100, 30, 2));
     63        model_->setPosition(Vector3(x*100-50,0,y*100-50));
     64
     65        this->attach(model_);
     66
     67        this->enableCollisionCallback();
     68        this->setCollisionResponse(true);
     69        this->setCollisionType(Static);
     70
    6871        cs_ = new BoxCollisionShape(context);
    69         model_->setMeshSource("cube.mesh");
    70         model_->setScale3D(Vector3(50, 30, 2));
    71         model_->setPosition(Vector3(x*100-50,0,y*100-50));
     72        cs_->setHalfExtents(Vector3(100, 30, 2));
    7273        cs_->setPosition(Vector3(x*100-50,0,y*100-50));
    73         cs_->setHalfExtents(Vector3(50, 30, 2));
    7474
    75 
    76 
     75        this->attachCollisionShape(cs_);
    7776    }
    7877
Note: See TracChangeset for help on using the changeset viewer.