Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9167 in orxonox.OLD


Ignore:
Timestamp:
Jul 4, 2006, 8:20:52 PM (18 years ago)
Author:
bensch
Message:

new rail-proj

Location:
branches/presentation/src
Files:
5 edited
2 moved

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/defs/class_id.h

    r9131 r9167  
    226226  CL_ROCKET                     =    0x000003e1,
    227227  CL_LASER                      =    0x000003e2,
    228   CL_BOMB                       =    0x000003e3,
    229   CL_GROUND_TURRET              =    0x000003e4,
    230   CL_GUIDED_MISSILE             =    0x000003e5,
    231   CL_HYPERBLAST                 =    0x000003e6,
     228  CL_RAIL_PROJECTILE            =    0x000003e3,
     229  CL_BOMB                       =    0x000003e4,
     230  CL_GROUND_TURRET              =    0x000003e5,
     231  CL_GUIDED_MISSILE             =    0x000003e6,
     232  CL_HYPERBLAST                 =    0x000003e7,
    232233
    233234  // NPC's
  • branches/presentation/src/world_entities/WorldEntities.am

    r9158 r9167  
    3434                world_entities/projectiles/bomb.cc \
    3535                world_entities/projectiles/laser.cc \
     36                world_entities/projectiles/rail_projectile.cc \
    3637                world_entities/projectiles/test_bullet.cc \
    3738                world_entities/projectiles/rocket.cc \
     
    101102                projectiles/bomb.h \
    102103                projectiles/laser.h \
     104                projectiles/rail_projectile.h \
    103105                projectiles/test_bullet.h \
    104106                projectiles/rocket.h \
  • branches/presentation/src/world_entities/environments/model_entity.cc

    r7193 r9167  
    3232{
    3333  this->setClassID(CL_MODEL_ENTITY, "ModelEntity");
    34   this->toList(OM_ENVIRON_NOTICK);
     34  this->toList(OM_ENVIRON);
    3535
    3636  this->speed = NULL;
     
    7171void ModelEntity::setMomentum (float angle, float x, float y, float z)
    7272{
     73  Vector v(x,y,z);
     74  v.normalize();
    7375  if (this->momentum == NULL)
    7476    this->momentum = new Quaternion;
    75   *this->momentum = Quaternion(angle, Vector(x, y, z));
     77  *this->momentum = Quaternion(angle, v);
    7678}
    7779
    7880void ModelEntity::tick(float dt)
    7981{
     82  printf("TEST\n");
    8083  if (this->speed != NULL)
    8184    this->shiftCoor(*this->speed * dt);
  • branches/presentation/src/world_entities/projectiles/rail_projectile.cc

    r9165 r9167  
    3939  this->setClassID(CL_RAIL_PROJECTILE, "RailProjectile");
    4040
    41   this->loadModel("models/projectiles/rail_projectile.obj");
     41  this->loadModel("models/projectiles/test_projectile.obj", 100);
    4242
    4343  this->setMinEnergy(10);
    4444  this->setHealthMax(10);
    45   this->lifeSpan = 5.0;
     45  this->lifeSpan = .5f;
    4646
    4747  this->emitter = new DotEmitter(100, 5, M_2_PI);
  • branches/presentation/src/world_entities/space_ships/spacecraft_2d.cc

    r9159 r9167  
    424424        if (this->toTravelHeight != NULL)
    425425        {
    426           this->travelNode->shiftCoor(Vector(0, (*toTravelHeight - this->travelNode->getAbsCoor().y) * dt, 0));
     426          this->travelNode->shiftCoor(Vector(0, (*toTravelHeight - this->travelNode->getAbsCoor().y) * dt * 10.0, 0));
    427427          if (fabsf(this->travelNode->getAbsCoor().y - *this->toTravelHeight) < .1)
    428428          {
     
    435435        accel.y = 0.0;
    436436
    437 
    438437        Vector accelerationDir = this->getAbsDir().apply(accel * this->acceleration);
    439438        accelerationDir.y = 0.0;
    440 
    441 
    442         /*
    443                 if (this->getRelCoor().z > this->travelDistance.y && accel.z > 0.0)
    444                 accel.z = 0.0f;
    445                 if (this->getRelCoor().z < -this->travelDistance.y && accel.z < 0.0)
    446                 accel.z = 0.0f;
    447 
    448                 if (this->getRelCoor().x > this->travelDistance.x && accel.x > 0.0)
    449                 accel.x = 0.0f;
    450                 if (this->getRelCoor().x < -this->travelDistance.x && accel.x < 0.0)
    451                 accel.x = 0.0f;*/
    452 
    453439
    454440        // this is the air friction (necessary for a smooth control)
     
    523509      else if (cameraLook < -M_PI_4)
    524510        cameraLook = -M_PI_4;
    525       //this->cameraNode.setRelDirSoft(this->direction,10);
    526511    }
    527512  }
  • branches/presentation/src/world_entities/weapons/laser_cannon.cc

    r9159 r9167  
    7272
    7373  this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    74   this->setProjectileType(CL_LASER);
     74  this->setProjectileType(CL_RAIL_PROJECTILE);
    7575  this->prepareProjectiles(100);
    7676  this->setEmissionPoint(Vector(2.8,0,0) * 5.0);
Note: See TracChangeset for help on using the changeset viewer.