Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


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

better npc

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

Legend:

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

    r9161 r9164  
    2828#include "loading/load_param.h"
    2929
     30#include "effects/explosion.h"
     31
    3032CREATE_FACTORY(NPC2, CL_NPC_TEST2);
    3133
     
    3739
    3840  if ((float)rand()/RAND_MAX > .5f)
    39     this->loadModel("models/ships/bolido.obj", 3);
     41    this->loadModel("models/ships/bolido.obj", 6);
    4042  else
    41     this->loadModel("models/ships/gobblin.obj", 3);
     43    this->loadModel("models/ships/gobblin.obj", 6);
     44
     45
     46
    4247
    4348  this->shader = NULL;
    4449  if (likely(Shader::checkShaderAbility()))
    4550    this->shader = Shader::getShader("shaders/toon.vert", "shaders/toon.frag");
    46 
    47   this->obj = gluNewQuadric();
    4851
    4952  this->randomRotAxis = VECTOR_RAND(1);
     
    5861  if (this->shader)
    5962    Shader::unload(this->shader);
    60   gluDeleteQuadric(this->obj);
    6163}
    6264
     
    6567{
    6668  NPC::loadParams(root);
     69
     70}
     71
     72
     73void NPC2::destroy(WorldEntity* killer)
     74{
     75  Explosion::explode(this, Vector(10,10,10));
     76  this->toList(OM_DEAD);
    6777
    6878}
     
    92102  if (this->shader != NULL && this->shader != Shader::getActiveShader())
    93103    shader->activateShader();
    94   gluSphere(this->obj, 3, 10, 10);
     104
     105  this->getModel()->draw();
    95106  shader->deactivateShader();
    96107
  • branches/presentation/src/world_entities/npcs/npc_test.h

    r9161 r9164  
    1818  void addAI(AI* ai);
    1919
     20  virtual void destroy(WorldEntity* killer);
     21
    2022  virtual void tick(float dt);
    2123  virtual void draw() const;
     
    2426   Vector   randomRotAxis;
    2527   Shader*  shader;
    26    GLUquadricObj* obj;
    27 
    2828};
    2929
Note: See TracChangeset for help on using the changeset viewer.