Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 9, 2011, 7:45:14 PM (13 years ago)
Author:
landauf
Message:

added "scale" for radar viewables. scale is relative, 1.0 means "normal".
rocket and simple rocket are now visible on the radar as small triangles.
greatly reduced lifetime of simple rocket.
fixed another possible cause for flashing hud radar.

Location:
code/trunk/src/modules/weapons/projectiles
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/weapons/projectiles/Rocket.cc

    r8706 r8738  
    5252        Constructor. Registers the object and initializes some default values.
    5353    */
    54     Rocket::Rocket(BaseObject* creator) : ControllableEntity(creator), BasicProjectile()
     54    Rocket::Rocket(BaseObject* creator)
     55        : ControllableEntity(creator)
     56        , BasicProjectile()
     57        , RadarViewable(creator, static_cast<WorldEntity*>(this))
    5558    {
    5659        RegisterObject(Rocket);// - register the Rocket class to the core
     
    106109        camPosition->setAllowMouseLook(true);
    107110        this->addCameraPosition(camPosition);
     111
     112        this->setRadarObjectColour(ColourValue(1.0, 0.5, 0.0)); // orange
     113        this->setRadarObjectShape(RadarViewable::Triangle);
     114        this->setRadarObjectScale(0.5f);
    108115    }
    109116
  • code/trunk/src/modules/weapons/projectiles/Rocket.h

    r8706 r8738  
    3434#include "tools/Timer.h"
    3535#include "worldentities/ControllableEntity.h"
     36#include "interfaces/RadarViewable.h"
    3637
    3738#include "BasicProjectile.h"
     
    4849        Oli Scheuss
    4950    */
    50     class _WeaponsExport Rocket : public ControllableEntity, public BasicProjectile
     51    class _WeaponsExport Rocket : public ControllableEntity, public BasicProjectile, public RadarViewable
    5152    {
    5253        public:
  • code/trunk/src/modules/weapons/projectiles/SimpleRocket.cc

    r8706 r8738  
    4848    CreateFactory(SimpleRocket);
    4949
    50     SimpleRocket::SimpleRocket(BaseObject* creator) : ControllableEntity(creator), BasicProjectile()
     50    SimpleRocket::SimpleRocket(BaseObject* creator)
     51        : ControllableEntity(creator)
     52        , BasicProjectile()
     53        , RadarViewable(creator, static_cast<WorldEntity*>(this))
    5154    {
    5255        RegisterObject(SimpleRocket);// - register the SimpleRocket class to the core
    5356
    5457        this->localAngularVelocity_ = 0;
    55         this->lifetime_ = 120;
     58        this->lifetime_ = 10;
    5659
    5760        this->setMass(15);
     
    8689        }
    8790
     91        this->setRadarObjectColour(ColourValue(1.0, 1.0, 0.0)); // yellow
     92        this->setRadarObjectShape(RadarViewable::Triangle);
     93        this->setRadarObjectScale(0.5f);
    8894    }
    8995
  • code/trunk/src/modules/weapons/projectiles/SimpleRocket.h

    r8706 r8738  
    3535#include "worldentities/ControllableEntity.h"
    3636#include "graphics/ParticleSpawner.h"
     37#include "interfaces/RadarViewable.h"
    3738
    3839#include "BasicProjectile.h"
     
    4849       Gabriel Nadler (Original file: Oli Scheuss)
    4950    */
    50     class _WeaponsExport SimpleRocket : public ControllableEntity, public BasicProjectile
     51    class _WeaponsExport SimpleRocket : public ControllableEntity, public BasicProjectile, public RadarViewable
    5152    {
    5253        public:
Note: See TracChangeset for help on using the changeset viewer.