Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9173 in orxonox.OLD


Ignore:
Timestamp:
Jul 4, 2006, 9:57:33 PM (18 years ago)
Author:
bensch
Message:

added attractor_mine

Location:
branches/presentation/src
Files:
3 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/defs/class_id.h

    r9167 r9173  
    236236  CL_NPC_TEST2                  =    0x00000402,
    237237  CL_GENERIC_NPC                =    0x00000403,
     238  CL_ATTRACTOR_MINE             =    0x00000404,
    238239
    239240  // Testing Entities
  • branches/presentation/src/world_entities/WorldEntities.am

    r9167 r9173  
    77                world_entities/npcs/door.cc \
    88                world_entities/npcs/repair_station.cc \
     9                world_entities/npcs/attractor_mine.cc \
    910                \
    1011                world_entities/environment.cc \
     
    7475                npcs/ground_turret.h \
    7576                npcs/door.cc \
    76                 npcs/repair_station.cc \
     77                npcs/repair_station.h \
     78                npcs/attractor_mine.h \
    7779                \
    7880                environment.h \
  • branches/presentation/src/world_entities/npcs/attractor_mine.cc

    r9172 r9173  
    1818
    1919
    20 #include "npc_test.h"
    21 #include "obb_tree.h"
     20#include "attractor_mine.h"
     21
    2222
    2323#include "shader.h"
     
    3030#include "effects/explosion.h"
    3131
    32 CREATE_FACTORY(NPC2, CL_NPC_TEST2);
     32CREATE_FACTORY(AttractorMine, CL_ATTRACTOR_MINE);
    3333
    3434
    35 NPC2::NPC2(const TiXmlElement* root)
     35AttractorMine::AttractorMine(const TiXmlElement* root)
    3636  : NPC(NULL)
    3737{
    38   this->setClassID(CL_NPC_TEST2, "NPC2");
     38  this->setClassID(CL_ATTRACTOR_MINE, "AttractorMine");
    3939
    4040  if ((float)rand()/RAND_MAX > .5f)
     
    5757
    5858
    59 NPC2::~NPC2 ()
     59AttractorMine::~AttractorMine ()
    6060{
    6161  if (this->shader)
     
    6464
    6565
    66 void NPC2::loadParams(const TiXmlElement* root)
     66void AttractorMine::loadParams(const TiXmlElement* root)
    6767{
    6868  NPC::loadParams(root);
     
    7171
    7272
    73 void NPC2::destroy(WorldEntity* killer)
     73void AttractorMine::destroy(WorldEntity* killer)
    7474{
    7575  Explosion::explode(this, Vector(10,10,10));
     
    8686 * Just override this function with whatever you want to be drawn.
    8787 */
    88 void NPC2::draw() const
     88void AttractorMine::draw() const
    8989{
    9090  glMatrixMode(GL_MODELVIEW);
     
    113113
    114114
    115 void NPC2::tick(float dt)
     115void AttractorMine::tick(float dt)
    116116{
    117117//  Vector direction = (State::getCameraTarget()->getAbsCoor() - this->getAbsCoor());
     
    119119  //if (directin.len() < 100)
    120120//  this->shiftCoor(direction *dt * 5 * exp(-direction.len() / 30.0));
    121   this->shiftDir(Quaternion(dt, this->randomRotAxis));
     121//  this->shiftDir(Quaternion(dt, this->randomRotAxis));
    122122
    123123}
  • branches/presentation/src/world_entities/npcs/attractor_mine.h

    r9172 r9173  
    11
    2 #ifndef _NPC22_H
    3 #define _NPC2_H
     2#ifndef _ATTRACTOR_MINE_H
     3#define _ATTRACTOR_MINE_H
    44
    55#include "npc.h"
     
    88class Shader;
    99
    10 class NPC2 : public NPC {
     10class AttractorMine : public NPC {
    1111
    1212 public:
    13   NPC2 (const TiXmlElement* root);
    14   virtual ~NPC2 ();
     13  AttractorMine (const TiXmlElement* root);
     14  virtual ~AttractorMine ();
    1515
    1616  virtual void loadParams(const TiXmlElement* root);
     
    2828};
    2929
    30 #endif /* _NPC2_H */
     30#endif /* _ATTRACTOR_MINE_H */
  • branches/presentation/src/world_entities/npcs/npc_test.cc

    r9171 r9173  
    119119  //if (directin.len() < 100)
    120120//  this->shiftCoor(direction *dt * 5 * exp(-direction.len() / 30.0));
    121   this->shiftDir(Quaternion(dt, this->randomRotAxis));
     121//  this->shiftDir(Quaternion(dt, this->randomRotAxis));
    122122
    123123}
Note: See TracChangeset for help on using the changeset viewer.