Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

added attractor_mine

File:
1 copied

Legend:

Unmodified
Added
Removed
  • 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}
Note: See TracChangeset for help on using the changeset viewer.