Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8943 in orxonox.OLD for branches/single_player_map/src


Ignore:
Timestamp:
Jun 30, 2006, 3:21:44 AM (18 years ago)
Author:
patrick
Message:

model sticks to ground. no wall cd yet

Location:
branches/single_player_map/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/single_player_map/src/lib/collision_reaction/cr_physics_ground_walk.cc

    r8940 r8943  
    121121        {
    122122          entity->shiftCoor(Vector(0.0f, -height, 0.0f));
    123 //           entity->setOnGround(true);
     123          entity->setOnGround(true);
    124124        }
    125125        // object is already in the wall
     
    131131        {
    132132          // entity is not on ground
    133 //           entity->setOnGround(false);
     133          entity->setOnGround(false);
    134134        }
    135135        break;
  • branches/single_player_map/src/lib/graphics/importer/interactive_model.h

    r8894 r8943  
    4040    virtual int getAnimation() = 0;
    4141
     42    virtual bool isAnimationFinished() { return false; }
     43
    4244    virtual void setAnimationSpeed(float speed) {}
    4345};
  • branches/single_player_map/src/lib/graphics/importer/md2/md2Model.h

    r8894 r8943  
    161161  inline int MD2Model::getAnimation() { return this->animationState.type; }
    162162  virtual void setAnimationSpeed(float speed) { this->animationSpeed = speed; }
     163  virtual bool isAnimationFinished() { return (this->animationState.currentFrame == this->animationState.endFrame )?true:false; }
    163164  /**  scales the current model @param scaleFactor: the factor [0..1] to use for scaling */
    164165  void scaleModel(float scaleFactor) { this->scaleFactor = scaleFactor;}
  • branches/single_player_map/src/world_entities/WorldEntities.am

    r8927 r8943  
    66                world_entities/npcs/generic_npc.cc \
    77                world_entities/npcs/door.cc \
     8                world_entities/npcs/repair_station.cc \
    89                \
    910                world_entities/environment.cc \
     
    6768                npcs/ground_turret.h \
    6869                npcs/door.cc \
     70                npcs/repair_station.cc \
    6971                \
    7072                environment.h \
  • branches/single_player_map/src/world_entities/creatures/fps_player.cc

    r8940 r8943  
    259259  if( !this->isOnGround())
    260260  {
    261     this->fallVelocity += 10.0f * time;
     261    this->fallVelocity += 100.0f * time;
    262262    velocity -= Vector(0.0, 1.0, 0.0) * this->fallVelocity;
    263263  }
  • branches/single_player_map/src/world_entities/npcs/repair_station.cc

    r8942 r8943  
    7575
    7676  this->toList(OM_COMMON);
    77   this->bLocked = false;
    7877
    7978  this->loadMD2Texture("maps/doors.jpg");
    8079  this->loadModel("models/creatures/doors.md2", this->scale);
    8180
    82   this->setAnimation(REPAIR_CYCLE00, MD2_ANIM_ONCE);
     81  this->setAnimation(REPAIR_CYCLE01, MD2_ANIM_ONCE);
    8382}
    8483
     
    116115}
    117116
     117
     118/**
     119 * @returns the current animation number
     120 */
     121int RepairStation::getAnimation()
     122{
     123  if( likely(this->getModel(0) != NULL))
     124    ((InteractiveModel*)this->getModel(0))->getAnimation();
     125}
    118126
    119127
     
    155163    ((InteractiveModel*)this->getModel(0))->tick(time);
    156164
    157 //   if( ((MD2Model*)this->getModel(0))->getAnimation() != ATTACK)
     165   if( this->getAnimation() == ATTACK)
    158166//     ((MD2Model*)this->getModel(0))->setAnimation(ATTACK);
    159167
    160168
    161169  this->setAnimation( this->animationCurrent, MD2_ANIM_ONCE);
    162   this->animationCurrent = (this->animationCurrent + this->animationStep)%RAPAIR_MAX_ANIMATION;
     170  this->animationCurrent = (this->animationCurrent + this->animationStep) % REPAIR_MAX_ANIMATIONS;
    163171}
    164172
  • branches/single_player_map/src/world_entities/npcs/repair_station.h

    r8941 r8943  
    3434    virtual void loadParams(const TiXmlElement* root);
    3535
    36     void setActionRadius(float radius) { this->actionRadius = radius; }
    3736    void setScale(float scale) { this->scale = scale; }
    3837
     
    4645  private:
    4746    void setAnimation(int animNum, int playbackMode = 0);
     47    int getAnimation();
    4848
    4949
Note: See TracChangeset for help on using the changeset viewer.