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/RocketController.cc

    r6817 r6834  
    3232#include "weapons/projectiles/SimpleRocket.h"
    3333#include "util/Debug.h"
    34 
     34#include "weapons/weaponmodes/SimpleRocketFire.h"
    3535
    3636namespace orxonox
     
    4545
    4646        RegisterObject(RocketController);
    47                 SimpleRocket* rocket = new SimpleRocket(this);
    48                 rocket->setController(this);
     47                this->rocket = new SimpleRocket(this);
     48                this->rocket->setController(dynamic_cast<RocketController*>(this));
    4949                this->setControllableEntity(dynamic_cast<ControllableEntity*> (rocket));
    50 
    5150    }
    5251
     
    6261
    6362        SimpleRocket *rocket = static_cast<SimpleRocket*>(this->getControllableEntity());
    64 
    65 
    66                 rocket->rotateYaw(0.2);
    67                         //rocket->moveFrontBack(2);
     63                double rd = rand();
     64                if (rd > 0.5) rocket->rotateRoll(5);
     65                else rocket->rotatePitch(5);
    6866
    6967    }
Note: See TracChangeset for help on using the changeset viewer.