Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

collision fix

Location:
branches/presentation/src/world_entities/projectiles
Files:
5 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
Note: See TracChangeset for help on using the changeset viewer.