Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1602


Ignore:
Timestamp:
Jun 14, 2008, 7:20:00 PM (16 years ago)
Author:
landauf
Message:
  • added thruster flares
  • used new particle effects
  • enemies with less health emit smoke and fire

!!!! MEDIA UPDATE !!!

Location:
code/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/bin/levels/sample.oxw

    r1557 r1602  
    4444for i = 1, 226, 1
    4545do ?>
    46   <Model position="<?lua print(math.random() * 40000 - 20000)?>, <?lua print(math.random() * 40000 - 20000) ?>, <?lua print(math.random() * 40000 - 20000) ?>" scale="<?lua print(math.random() * 100 + 20) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" rotationAxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationRate="<?lua print(math.random() * 30 + 15) ?>" />
     46  <Model position="<?lua print(math.random() * 40000 - 20000)?>, <?lua print(math.random() * 40000 - 20000) ?>, <?lua print(math.random() * 40000 - 20000) ?>" scale="<?lua print(math.random() * 250 + 20) ?>" mesh="ast<?lua print( math.mod(i,6) + 1) ?>.mesh" rotationAxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationRate="<?lua print(math.random() * 30 + 15) ?>" />
    4747<?lua
    4848end
  • code/trunk/src/orxonox/objects/ParticleSpawner.cc

    r1563 r1602  
    4141    {
    4242        RegisterObject(ParticleSpawner);
     43        this->particle_ = 0;
    4344    }
    4445
     
    4647    {
    4748        RegisterObject(ParticleSpawner);
     49        this->setParticle(templateName, detaillevel, lifetime, delay, direction);
     50    }
    4851
     52    void ParticleSpawner::setParticle(const std::string& templateName, LODParticle::LOD detaillevel, float lifetime, float delay, const Vector3& direction)
     53    {
    4954        ExecutorMember<ParticleSpawner>* executor = createExecutor(createFunctor(&ParticleSpawner::createParticleSpawner));
    5055        executor->setDefaultValues(lifetime);
     
    6166    ParticleSpawner::~ParticleSpawner()
    6267    {
    63         if (this->isInitialized())
     68        if (this->isInitialized() && this->particle_)
    6469        {
    6570            this->particle_->detachFromSceneNode();
     
    7075    void ParticleSpawner::createParticleSpawner(float lifetime)
    7176    {
    72         this->timer_.setTimer(lifetime, false, this, createExecutor(createFunctor(&ParticleSpawner::destroyParticleSpawner)));
    7377        this->particle_->setEnabled(true);
     78        if (lifetime != 0)
     79            this->timer_.setTimer(lifetime, false, this, createExecutor(createFunctor(&ParticleSpawner::destroyParticleSpawner)));
    7480    }
    7581
     
    7884        delete this;
    7985    }
     86
     87    void ParticleSpawner::setVisible(bool visible)
     88    {
     89        if (this->particle_)
     90            this->particle_->setEnabled(visible);
     91    }
    8092}
  • code/trunk/src/orxonox/objects/ParticleSpawner.h

    r1563 r1602  
    4141        public:
    4242            ParticleSpawner();
    43             ParticleSpawner(const std::string& templateName, LODParticle::LOD detaillevel, float lifetime, float delay = 0, const Vector3& direction = Vector3::ZERO);
     43            ParticleSpawner(const std::string& templateName, LODParticle::LOD detaillevel, float lifetime = 0, float delay = 0, const Vector3& direction = Vector3::ZERO);
    4444            virtual ~ParticleSpawner();
     45
     46            void setParticle(const std::string& templateName, LODParticle::LOD detaillevel, float lifetime = 0, float delay = 0, const Vector3& direction = Vector3::ZERO);
    4547            inline ParticleInterface* getParticleInterface() const
    4648                { return this->particle_; }
     49
     50            void setVisible(bool visible);
    4751
    4852        private:
  • code/trunk/src/orxonox/objects/Projectile.cc

    r1576 r1602  
    5050
    5151        this->setConfigValues();
    52         this->explosionTemplateName_ = "Orxonox/explosion1";
    53         this->smokeTemplateName_ = "Orxonox/smoke3";
     52        this->explosionTemplateName_ = "Orxonox/explosion3";
     53        this->smokeTemplateName_ = "Orxonox/smoke4";
    5454
    5555        if (this->owner_)
     
    101101                    explosion->setPosition(this->getPosition());
    102102                    explosion->create();
    103                     ParticleSpawner* smoke = new ParticleSpawner(this->smokeTemplateName_, LODParticle::normal, 6.0, 0.0);
     103                    ParticleSpawner* smoke = new ParticleSpawner(this->smokeTemplateName_, LODParticle::normal, 2.0, 0.0);
    104104                    smoke->setPosition(this->getPosition());
    105                     smoke->getParticleInterface()->setSpeedFactor(3.0);
     105//                    smoke->getParticleInterface()->setSpeedFactor(3.0);
    106106                    smoke->create();
    107107                    delete this;
  • code/trunk/src/orxonox/objects/SpaceShip.cc

    r1564 r1602  
    132132        this->teamNr_ = 0;
    133133        this->health_ = 100;
    134 
    135         COUT(3) << "Info: SpaceShip was loaded" << std::endl;
    136134    }
    137135
     
    209207        node2b->setScale(0.5, 0.5, 0.5);
    210208        tt2_->addToSceneNode(node2b);
     209
     210        this->leftThrusterFlare_.setBillboardSet("Flares/ThrusterFlare1", Vector3(-7.5, -10, -0.5));
     211        this->rightThrusterFlare_.setBillboardSet("Flares/ThrusterFlare1", Vector3(-7.5, 10, -0.5));
     212
     213        Ogre::SceneNode* node2c = this->getNode()->createChildSceneNode(this->getName() + "particle2c");
     214        node2c->setInheritScale(false);
     215        node2c->setScale(2, 2, 2);
     216        node2c->attachObject(this->leftThrusterFlare_.getBillboardSet());
     217        node2c->attachObject(this->rightThrusterFlare_.getBillboardSet());
    211218        // END CREATING THRUSTER
    212219
     
    226233        this->greenNode_->setScale(0.3, 0.3, 0.3);
    227234        // END CREATING BLINKING LIGHTS
     235
     236        this->smoke_.setParticle("Orxonox/smoke5", LODParticle::normal);
     237        this->fire_.setParticle("Orxonox/fire3", LODParticle::normal);
     238        this->attachObject(this->smoke_);
     239        this->attachObject(this->fire_);
    228240
    229241        if (this->isExactlyA(Class(SpaceShip)))
     
    266278        this->crosshairNear_.setVisible(this->isVisible());
    267279        this->crosshairFar_.setVisible(this->isVisible());
     280        this->rightThrusterFlare_.setVisible(this->isVisible());
     281        this->leftThrusterFlare_.setVisible(this->isVisible());
     282        this->smoke_.setVisible(this->isVisible());
     283        this->fire_.setVisible(this->isVisible());
    268284    }
    269285
     
    278294        this->crosshairNear_.setVisible(this->isVisible());
    279295        this->crosshairFar_.setVisible(this->isVisible());
     296        this->rightThrusterFlare_.setVisible(this->isVisible());
     297        this->leftThrusterFlare_.setVisible(this->isVisible());
    280298    }
    281299
     
    385403            this->cam_->tick(dt);
    386404
     405        this->smoke_.setVisible(this->isVisible() && this->health_ < 40);
     406        this->fire_.setVisible(this->isVisible() && this->health_ < 20);
     407
    387408        if (this->redNode_ && this->greenNode_)
    388409        {
  • code/trunk/src/orxonox/objects/SpaceShip.h

    r1558 r1602  
    3737#include "Model.h"
    3838#include "tools/BillboardSet.h"
     39#include "ParticleSpawner.h"
    3940
    4041namespace orxonox
     
    141142            ParticleInterface* tt1_;
    142143            ParticleInterface* tt2_;
     144            BillboardSet leftThrusterFlare_;
     145            BillboardSet rightThrusterFlare_;
    143146
    144147            BillboardSet redBillboard_;
     
    147150            Ogre::SceneNode* greenNode_;
    148151            float blinkTime_;
     152
     153            ParticleSpawner smoke_;
     154            ParticleSpawner fire_;
    149155
    150156            BillboardSet crosshairNear_;
  • code/trunk/src/orxonox/objects/WorldEntity.cc

    r1559 r1602  
    172172    {
    173173        this->attachedWorldEntities_.push_back(entity);
     174        this->attachObject(entity);
    174175    }
    175176
     
    181182            return 0;
    182183    }
     184
     185    void WorldEntity::attachObject(const WorldEntity& obj) const
     186    {
     187        GraphicsEngine::getSingleton().getSceneManager()->getRootSceneNode()->removeChild(obj.getNode());
     188        this->getNode()->addChild(obj.getNode());
     189    }
     190
     191    void WorldEntity::attachObject(WorldEntity* obj) const
     192    {
     193        GraphicsEngine::getSingleton().getSceneManager()->getRootSceneNode()->removeChild(obj->getNode());
     194        this->getNode()->addChild(obj->getNode());
     195    }
    183196}
  • code/trunk/src/orxonox/objects/WorldEntity.h

    r1535 r1602  
    5858            const WorldEntity* getAttachedWorldEntity(unsigned int index) const;
    5959
    60             inline Ogre::SceneNode* getNode()
     60            inline Ogre::SceneNode* getNode() const
    6161                { return this->node_; }
    6262
     
    7575                { return this->node_->getPosition(); }
    7676
    77             inline void translate(const Vector3 &d, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
     77            inline void translate(const Vector3& d, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
    7878                { this->node_->translate(d, relativeTo); }
    7979            inline void translate(Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
    8080                { this->node_->translate(x, y, z, relativeTo); }
    81             inline void translate(const Matrix3 &axes, const Vector3 &move, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
     81            inline void translate(const Matrix3& axes, const Vector3& move, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
    8282                { this->node_->translate(axes, move, relativeTo); }
    83             inline void translate(const Matrix3 &axes, Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
     83            inline void translate(const Matrix3& axes, Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_PARENT)
    8484                { this->node_->translate(axes, x, y, z, relativeTo); }
    8585
    86             inline void yaw(const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
     86            inline void yaw(const Radian& angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
    8787                { this->node_->yaw(angle, relativeTo); }
    88             inline void pitch(const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
     88            inline void pitch(const Radian& angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
    8989                { this->node_->pitch(angle, relativeTo); }
    90             inline void roll(const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
     90            inline void roll(const Radian& angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
    9191                { this->node_->roll(angle, relativeTo); }
    9292            void setYawPitchRoll(const Degree& yaw, const Degree& pitch, const Degree& roll);
    9393
    94             inline void setYaw(const Degree &angle)
     94            inline void setYaw(const Degree& angle)
    9595                { this->node_->yaw(angle, Ogre::Node::TS_LOCAL); }
    96             inline void setPitch(const Degree &angle)
     96            inline void setPitch(const Degree& angle)
    9797                { this->node_->pitch(angle, Ogre::Node::TS_LOCAL); }
    98             inline void setRoll(const Degree &angle)
     98            inline void setRoll(const Degree& angle)
    9999                { this->node_->roll(angle, Ogre::Node::TS_LOCAL); }
    100100
     
    103103            inline void setOrientation(const Ogre::Quaternion& quat)
    104104              { this->node_->setOrientation(quat); }
    105             inline void rotate(const Vector3 &axis, const Radian &angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
     105            inline void rotate(const Vector3& axis, const Radian& angle, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL)
    106106              { this->node_->rotate(axis, angle, relativeTo); }
    107107            inline void setDirectionLoader(Real x, Real y, Real z)
    108108              { this->setDirection(x, y, z); }
    109             inline void setDirection(Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
     109            inline void setDirection(Real x, Real y, Real z, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3& localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
    110110              { this->node_->setDirection(x, y, z, relativeTo, localDirectionVector); }
    111             inline void setDirection(const Vector3 &vec, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
     111            inline void setDirection(const Vector3& vec, Ogre::Node::TransformSpace relativeTo=Ogre::Node::TS_LOCAL, const Vector3& localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
    112112              { this->node_->setDirection(vec, relativeTo, localDirectionVector); }
    113             inline void lookAt(const Vector3 &targetPoint, Ogre::Node::TransformSpace relativeTo, const Vector3 &localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
     113            inline void lookAt(const Vector3& targetPoint, Ogre::Node::TransformSpace relativeTo, const Vector3& localDirectionVector=Vector3::NEGATIVE_UNIT_Z)
    114114              { this->node_->lookAt(targetPoint, relativeTo, localDirectionVector); }
    115115
    116             inline void setScale(const Vector3 &scale)
     116            inline void setScale(const Vector3& scale)
    117117              { this->node_->setScale(scale); }
    118118            inline void setScale(Real x, Real y, Real z)
     
    124124            inline const Vector3& getScale(void) const
    125125              { return this->node_->getScale(); }
    126             inline void scale(const Vector3 &scale)
     126            inline void scale(const Vector3& scale)
    127127              { this->node_->scale(scale); }
    128128            inline void scale(Real x, Real y, Real z)
     
    131131              { this->node_->scale(scale, scale, scale); }
    132132
    133             inline void attachObject(Ogre::MovableObject *obj)
     133            void attachObject(const WorldEntity& obj) const;
     134            void attachObject(WorldEntity* obj) const;
     135            inline void attachObject(Ogre::MovableObject* obj) const
    134136              { this->node_->attachObject(obj); }
    135             inline void attachObject(Mesh &mesh)
     137            inline void attachObject(Mesh& mesh) const
    136138              { this->node_->attachObject(mesh.getEntity()); }
    137             inline void detachObject(Ogre::MovableObject *obj)
     139            inline void detachObject(Ogre::MovableObject* obj) const
    138140              { this->node_->detachObject(obj); }
    139             inline void detachAllObjects()
     141            inline void detachAllObjects() const
    140142              { this->node_->detachAllObjects(); }
    141143
     
    179181            inline void setStatic(bool bStatic)
    180182                { this->bStatic_ = bStatic; }
    181             inline bool isStatic()
     183            inline bool isStatic() const
    182184                { return this->bStatic_; }
    183185
  • code/trunk/src/orxonox/tools/BillboardSet.cc

    r1505 r1602  
    4646    }
    4747
    48     void BillboardSet::setBillboardSet(const std::string& file, const ColourValue& colour, int count, const Vector3& position)
     48    void BillboardSet::setBillboardSet(const std::string& file, int count)
     49    {
     50        std::ostringstream name;
     51        name << (BillboardSet::billboardSetCounter_s++);
     52        this->billboardSet_ = GraphicsEngine::getSingleton().getSceneManager()->createBillboardSet("Billboard" + name.str(), count);
     53        this->billboardSet_->createBillboard(Vector3::ZERO);
     54        this->billboardSet_->setMaterialName(file);
     55    }
     56
     57    void BillboardSet::setBillboardSet(const std::string& file, const ColourValue& colour, int count)
     58    {
     59        std::ostringstream name;
     60        name << (BillboardSet::billboardSetCounter_s++);
     61        this->billboardSet_ = GraphicsEngine::getSingleton().getSceneManager()->createBillboardSet("Billboard" + name.str(), count);
     62        this->billboardSet_->createBillboard(Vector3::ZERO, colour);
     63        this->billboardSet_->setMaterialName(file);
     64    }
     65
     66    void BillboardSet::setBillboardSet(const std::string& file, const Vector3& position, int count)
     67    {
     68        std::ostringstream name;
     69        name << (BillboardSet::billboardSetCounter_s++);
     70        this->billboardSet_ = GraphicsEngine::getSingleton().getSceneManager()->createBillboardSet("Billboard" + name.str(), count);
     71        this->billboardSet_->createBillboard(position);
     72        this->billboardSet_->setMaterialName(file);
     73    }
     74
     75    void BillboardSet::setBillboardSet(const std::string& file, const ColourValue& colour, const Vector3& position, int count)
    4976    {
    5077        std::ostringstream name;
  • code/trunk/src/orxonox/tools/BillboardSet.h

    r1558 r1602  
    4444            BillboardSet();
    4545            ~BillboardSet();
    46             void setBillboardSet(const std::string& file, const ColourValue& colour = ColourValue(1.0, 1.0, 1.0), int count = 1, const Vector3& position = Vector3::ZERO);
     46            void setBillboardSet(const std::string& file, int count = 1);
     47            void setBillboardSet(const std::string& file, const ColourValue& colour, int count = 1);
     48            void setBillboardSet(const std::string& file, const Vector3& position, int count = 1);
     49            void setBillboardSet(const std::string& file, const ColourValue& colour, const Vector3& position, int count = 1);
    4750
    4851            inline Ogre::BillboardSet* getBillboardSet()
Note: See TracChangeset for help on using the changeset viewer.