Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 3, 2010, 1:40:16 PM (14 years ago)
Author:
gnadler
Message:

Success:
Now rocket spawns somewhere around the ship and the orientation is more or less correct. The controller does nothing but change some pitch/roll (to be sure it does something).
I modified the rocketfire particle to produce rocketfire2.particle which is slightly smaller and matches the smaller rocket.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/rocket/src/modules/weapons/projectiles/SimpleRocket.cc

    r6827 r6834  
    6060        this->lifetime_ = 100;
    6161                COUT(0)<< "simplerocket constructed\n";
    62                 //this->camera_ = null;
    63                 //RocketController* myRController = new RocketController(this);
    64                 //this->setController(creator);
    65                 //myRController->setRocket(this, myRController);
    66                
    67                 //this->getController()->setControllableEntity(this);
    68                 //myController->setControllableEntity(this);
    69                 //this->getController()->setControllableEntity(this);
    70         //this->controllableEntity_->setController(this->controller_);
     62
    7163
    7264        //if (GameMode::isMaster())
    7365        //{
    74          /*   this->setCollisionType(WorldEntity::Kinematic);
    75             this->setVelocity(0,0,-100);*/
     66           this->setCollisionType(WorldEntity::Kinematic);
     67            this->setVelocity(0,0,100);
    7668
    7769            Model* model = new Model(this);
    7870            model->setMeshSource("rocket.mesh");
    79             //model->scale(0.7f);
     71            model->scale(0.7f);
    8072            this->attach(model);
    81            /* ParticleEmitter* fire = new ParticleEmitter(this);
     73
     74            ParticleEmitter* fire = new ParticleEmitter(this);
    8275            this->attach(fire);
    8376            fire->setOrientation(this->getOrientation());
    84             fire->setSource("Orxonox/Rocketfire");
     77            fire->setSource("Orxonox/rocketfire2");
    8578
    8679            this->enableCollisionCallback();
     
    9184            collisionShape->setRadius(3);
    9285            collisionShape->setHeight(500);
    93             this->attachCollisionShape(collisionShape);*/
     86            this->attachCollisionShape(collisionShape);
    9487
    9588            this->destroyTimer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&SimpleRocket::destroyObject, this)));
     
    127120    }
    128121
    129     /**
    130     @brief
    131         Defines which actions the SimpleRocket has to take in each tick.
    132     @param dt
    133         The length of the tick.
    134     */
    135     void SimpleRocket::tick(float dt)
    136     {
    137         SUPER(SimpleRocket, tick, dt);
    138 
    139         if( this->hasLocalController() )
    140         {
    141             this->setAngularVelocity(this->getOrientation() * this->localAngularVelocity_);
    142             this->setVelocity( this->getOrientation()*WorldEntity::FRONT*this->getVelocity().length() );
    143             this->localAngularVelocity_ = 0;
    144 
    145             if( this->bDestroy_ )
    146                 this->destroy();
    147         }
    148     }
    149122
    150123    bool SimpleRocket::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
Note: See TracChangeset for help on using the changeset viewer.