Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9161 in orxonox.OLD for branches/presentation/src


Ignore:
Timestamp:
Jul 4, 2006, 6:07:10 PM (18 years ago)
Author:
bensch
Message:

new NPC

Location:
branches/presentation/src/world_entities/npcs
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/world_entities/npcs/npc.cc

    r9003 r9161  
    5151void NPC::loadParams(const TiXmlElement* root)
    5252{
    53   if(root != NULL)
    5453   WorldEntity::loadParams(root);
    5554}
  • branches/presentation/src/world_entities/npcs/npc_test.cc

    r8724 r9161  
    2323#include "shader.h"
    2424#include "state.h"
    25 #include "stdlibincl.h"
    2625#include "debug.h"
    2726
     27#include "loading/factory.h"
     28#include "loading/load_param.h"
    2829
    29 using namespace std;
     30CREATE_FACTORY(NPC2, CL_NPC_TEST2);
    3031
    3132
    32 NPC2::NPC2()
     33NPC2::NPC2(const TiXmlElement* root)
    3334  : NPC(NULL)
    3435{
     
    4748
    4849  this->randomRotAxis = VECTOR_RAND(1);
     50
     51  if (root != NULL)
     52    this->loadParams(root);
    4953}
    5054
     
    5559    Shader::unload(this->shader);
    5660  gluDeleteQuadric(this->obj);
     61}
     62
     63
     64void NPC2::loadParams(const TiXmlElement* root)
     65{
     66  NPC::loadParams(root);
     67
    5768}
    5869
     
    6778void NPC2::draw() const
    6879{
    69 //   glMatrixMode(GL_MODELVIEW);
    70 //   glPushMatrix();
    71 //   float matrix[4][4];
    72 //
    73 //   /* translate */
    74 //   glTranslatef (this->getAbsCoor ().x,
    75 //                 this->getAbsCoor ().y,
    76 //                 this->getAbsCoor ().z);
    77 //   /* rotate */
    78 //   this->getAbsDir ().matrix (matrix);
    79 //   glMultMatrixf((float*)matrix);
    80 //
    81 //   if (this->shader != NULL && this->shader != Shader::getActiveShader())
    82 //     shader->activateShader();
    83 //   gluSphere(this->obj, 3, 10, 10);
    84 //   shader->deactivateShader();
    85 //
    86 //
    87 // /*  if (this->model)
    88 //     this->model->draw();*/
    89 //   glPopMatrix();
     80  glMatrixMode(GL_MODELVIEW);
     81  glPushMatrix();
     82  float matrix[4][4];
     83
     84  /* translate */
     85  glTranslatef (this->getAbsCoor ().x,
     86                this->getAbsCoor ().y,
     87                this->getAbsCoor ().z);
     88  /* rotate */
     89  this->getAbsDir ().matrix (matrix);
     90  glMultMatrixf((float*)matrix);
     91
     92  if (this->shader != NULL && this->shader != Shader::getActiveShader())
     93    shader->activateShader();
     94  gluSphere(this->obj, 3, 10, 10);
     95  shader->deactivateShader();
     96
     97
     98/*  if (this->model)
     99    this->model->draw();*/
     100  glPopMatrix();
    90101}
    91102
  • branches/presentation/src/world_entities/npcs/npc_test.h

    r6981 r9161  
    1111
    1212 public:
    13   NPC2 ();
     13  NPC2 (const TiXmlElement* root);
    1414  virtual ~NPC2 ();
    1515
     16  virtual void loadParams(const TiXmlElement* root);
    1617
    1718  void addAI(AI* ai);
  • branches/presentation/src/world_entities/npcs/npc_test1.cc

    r8724 r9161  
    2424#include "power_ups/turret_power_up.h"
    2525#include "power_ups/laser_power_up.h"
    26 
    27 using namespace std;
    2826
    2927
Note: See TracChangeset for help on using the changeset viewer.