Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 24, 2012, 3:06:56 PM (13 years ago)
Author:
mpalic
Message:

Modified SimpleRocket to be able to use it for the SpaceBomb

Location:
code/branches/spacebomb/src/modules/weapons
Files:
2 edited

Legend:

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

    r8859 r9237  
    4444#include "graphics/ParticleSpawner.h"
    4545#include "infos/PlayerInfo.h"
    46 #include "objects/collisionshapes/ConeCollisionShape.h"
     46#include "objects/collisionshapes/SphereCollisionShape.h"
    4747#include "worldentities/pawns/Pawn.h"
    4848#include "sound/WorldSound.h"
    4949
    5050#include "weapons/RocketController.h"
     51
     52// NOTE this branch now has the spacebomb implementation in
     53// the simplerocket facilities since there is no time to implement
     54// a proper weapon for it now. DO NOT MERGE THIS INTO TRUNK.
     55
    5156
    5257namespace orxonox
     
    6469
    6570        this->localAngularVelocity_ = 0;
    66         this->lifetime_ = 10.f;
     71        this->lifetime_ = 100.f;
    6772
    6873        this->setMass(15.0);
     
    7580            // Create rocket model.
    7681            Model* model = new Model(this);
    77             model->setMeshSource("rocket.mesh");
    78             model->scale(0.7f);
     82            model->setMeshSource("Spacebomb.mesh");
     83            model->scale(0.3f);
    7984            this->attach(model);
    8085
    8186            // Add effects.
    82             this->fire_ = new ParticleEmitter(this);
    83             this->attach(this->fire_);
    84 
    85             this->fire_->setOrientation(this->getOrientation());
    86             this->fire_->setSource("Orxonox/simplerocketfire");
     87           
    8788            this->enableCollisionCallback();
    8889            this->setCollisionResponse(false);
     
    9192            // Add collision shape.
    9293            // TODO: fix the orientation and size of this collision shape to match the rocket
    93             ConeCollisionShape* collisionShape = new ConeCollisionShape(this);
     94            SphereCollisionShape* collisionShape = new SphereCollisionShape(this);
    9495            collisionShape->setOrientation(this->getOrientation());
    95             collisionShape->setRadius(1.5f);
    96             collisionShape->setHeight(5);
     96            collisionShape->setRadius(50.00f);
    9797            this->attachCollisionShape(collisionShape);
    9898
     
    102102        this->setRadarObjectColour(ColourValue(1.0, 1.0, 0.0)); // yellow
    103103        this->setRadarObjectShape(RadarViewable::Triangle);
    104         this->setRadarObjectScale(0.5f);
     104        this->setRadarObjectScale(0.3f);
    105105    }
    106106
     
    141141    {
    142142        this->setAcceleration(0,0,0);
    143         this->fire_->detachFromParent();
     143       
    144144    }
    145145
  • code/branches/spacebomb/src/modules/weapons/weaponmodes/SimpleRocketFire.cc

    r8855 r9237  
    8181        rocket->setOrientation(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getWorldOrientation());
    8282        rocket->setPosition(this->getMuzzlePosition());
    83         rocket->setVelocity(this->getMuzzleDirection()*this->speed_);
     83        rocket->setVelocity(0.0f,0.0f,0.0f);
    8484        rocket->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
    8585
Note: See TracChangeset for help on using the changeset viewer.