Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10737 in orxonox.OLD


Ignore:
Timestamp:
Jun 20, 2007, 6:17:06 PM (17 years ago)
Author:
nicolasc
Message:

collision fix

Location:
branches/presentation/src/world_entities
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/world_entities/projectiles/hbolt.cc

    r10698 r10737  
    2020#include "state.h"
    2121#include "model.h"
     22
     23#include "world_entities/npcs/actionbox_enemy.h"
    2224#include "world_entities/npcs/npc.h"
    2325
     
    125127{
    126128  printf("Collision with HBolt\n");
    127   if (this->hitEntity != entity && entity->isA(NPC::staticClassID()) || entity == this->target)
     129  if (this->hitEntity != entity/* && entity->isA(NPC::staticClassID())*/ && entity->isA(ActionboxEnemy::staticClassID()) || entity == this->target)
    128130    this->destroy( entity );
    129131  this->hitEntity = entity;
     
    148150  this->angle += HBolt::rotationSpeed * dt;
    149151
    150   for( ObjectList<NPC>::const_iterator eIterator = NPC::objectList().begin(); eIterator !=NPC::objectList().end(); eIterator++)
     152  for( ObjectList<ActionboxEnemy>::const_iterator eIterator = ActionboxEnemy::objectList().begin(); eIterator !=ActionboxEnemy::objectList().end(); eIterator++)
    151153  {
    152154    if( ((*eIterator)->getOMListNumber() != (this->origList -1))  && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 8)
  • branches/presentation/src/world_entities/projectiles/hbolt.h

    r10618 r10737  
    99#include "projectile.h"
    1010#include "effects/billboard.h"
     11
    1112
    1213class Vector;
  • branches/presentation/src/world_entities/projectiles/nadion_blast.cc

    r10728 r10737  
    2323#include "model.h"
    2424
     25#include "world_entities/npcs/actionbox_enemy.h"
    2526#include "world_entities/npcs/npc.h"
    2627
     
    149150}
    150151
    151 /*
    152 void NadionBlast::hit (float damage, WorldEntity* entity )
    153 {
    154 
    155   if (this->hitEntity != entity)
    156     this->destroy( entity );
    157   this->hitEntity = entity;
    158  // dynamic_cast<SpaceShip*>(entity)->damage(this->getPhysDamage(),this->getElecDamage());
    159   //this->destroy(this);
    160   this->deactivate();
    161 
    162   return;
    163 
    164 }*/
     152
     153// void NadionBlast::hit (float damage, WorldEntity* entity )
     154// {
     155//
     156//   if (this->hitEntity != entity)
     157//     this->destroy( entity );
     158//   this->hitEntity = entity;
     159// // dynamic_cast<SpaceShip*>(entity)->damage(this->getPhysDamage(),this->getElecDamage());
     160//   //this->destroy(this);
     161//   this->deactivate();
     162//
     163//   return;
     164//
     165// }
    165166
    166167/**
     
    180181//   this->trail->tick(dt);
    181182
    182   for( ObjectList<NPC>::const_iterator eIterator = NPC::objectList().begin(); eIterator !=NPC::objectList().end(); eIterator++)
     183  for( ObjectList<ActionboxEnemy>::const_iterator eIterator = ActionboxEnemy::objectList().begin(); eIterator !=ActionboxEnemy::objectList().end(); eIterator++)
    183184  {
    184185    if( ((*eIterator)->getOMListNumber() != (this->origList -1))  && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 8)
     
    215216//   glRotatef(this->angle, 1.0f, 0.0f, 0.0f); //spinning missile
    216217// HACK, need to be removed, once the AbsDir is correct, replace with the one above
    217   glRotatef(this->angle, this->flightDirection.x, this->flightDirection.y, this->flightDirection.z);
     218//   glRotatef(this->angle, this->flightDirection.x, this->flightDirection.y, this->flightDirection.z);
    218219  this->getAbsDir().matrix (matrix);
    219220  glMultMatrixf((float*)matrix);
  • branches/presentation/src/world_entities/projectiles/plasma_pulse.cc

    r10698 r10737  
    2121
    2222#include "state.h"
     23#include "world_entities/npcs/actionbox_enemy.h"
    2324
    2425#include <cassert>
     
    112113  this->grid->tick(dt);
    113114
    114   for( ObjectList<Playable>::const_iterator eIterator = Playable::objectList().begin(); eIterator !=Playable::objectList().end(); eIterator++)
     115  for( ObjectList<ActionboxEnemy>::const_iterator eIterator = ActionboxEnemy::objectList().begin(); eIterator !=ActionboxEnemy::objectList().end(); eIterator++)
    115116  {
    116117    if( ((*eIterator)->getOMListNumber() != (this->origList -1))  && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 3)
  • branches/presentation/src/world_entities/projectiles/test_bullet.cc

    r10114 r10737  
    136136  this->lifeCycle += time/this->lifeSpan;
    137137  if( this->lifeCycle >= 1.0)
    138     {
    139       PRINTF(5)("FINALIZE==========================\n");
    140       PRINTF(5)("current life cycle is: %f\n", this->lifeCycle);
    141       PRINTF(5)("FINALIZE===========================\n");
     138  {
     139    PRINTF(5)("FINALIZE==========================\n");
     140    PRINTF(5)("current life cycle is: %f\n", this->lifeCycle);
     141    PRINTF(5)("FINALIZE===========================\n");
    142142
    143       this->deactivate();
    144     }
     143    this->deactivate();
     144  }
    145145}
    146146
  • branches/presentation/src/world_entities/weapons/nadion_laser.cc

    r10733 r10737  
    155155//   pj->setAbsDir(Quaternion(this->getDefaultTarget()->getAbsCoor() - this->getAbsCoor(), Vector(0,0,0)));
    156156//   pj->setAbsDir(Quaternion(tmp.getNormalized(), this->getParent()->getAbsDir().apply(Vector(0,1,0))));
    157   pj->setAbsDir(Quaternion(dir, up.getNormalized()));
    158  
     157//   pj->setAbsDir(Quaternion(dir, up.getNormalized()));
     158  pj->setAbsDir(Quaternion(dir, Vector(1,0,0)));
     159
    159160  pj->setAbsDir(this->getAbsDir());
    160161  pj->activate();
  • branches/presentation/src/world_entities/world_entity.h

    r10721 r10737  
    226226  void setHealthRegen(float regen) { this->healthRegen = regen; };
    227227  void createImplantWidget();
    228     //  CharacterAttributes*    charAttr;         //!< the character attributes of a world_entity
    229228
    230229  void setShield(float shield) { this->shield = shield; };
     
    238237  void setElectronicTH(float th) { this->electronicTH = th; };
    239238  void setElectronicRegen(float regen) { this->electronicRegen = regen; };
    240  
     239
    241240  void setDamageable( bool damageable ){ this->damageable = damageable; }
    242241  bool getDamageable(){ return this->damageable; }
     
    270269  bool                    forwardDamageToParent;  //!< if true, damage taken will be forwardet to parent
    271270  float                   healthMax;              //!< The Maximal energy this entity can take.
    272   float                                         implantEnergy;          //!< energy of implants
    273   float                   healthRegen;        //!< Regeneration Rate of Health, mesured in units per second
     271  float                   implantEnergy;          //!< energy of implants
     272  float                   healthRegen;            //!< Regeneration Rate of Health, mesured in units per second
    274273  OrxGui::GLGuiEnergyWidgetVertical* healthWidget;    //!< The Slider (if wanted).
    275   OrxGui::GLGuiEnergyWidgetVertical* implantWidget; 
     274  OrxGui::GLGuiEnergyWidgetVertical* implantWidget;
    276275
    277276  float       shield;             //!< current shield
     
    324323  float                   healthMax_write;
    325324  int                     healthMax_handle;
    326  
     325
    327326
    328327
Note: See TracChangeset for help on using the changeset viewer.