Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8939 in orxonox.OLD for branches


Ignore:
Timestamp:
Jun 30, 2006, 2:35:50 AM (18 years ago)
Author:
patrick
Message:

world entity on ground function

Location:
branches/single_player_map/src/world_entities
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/single_player_map/src/world_entities/creatures/fps_player.cc

    r8900 r8939  
    9090  this->setHealth(80);
    9191
     92  this->fallVelocity = 0.0f;
    9293
    9394  this->cameraNode.setParent(this);
     
    251252  }
    252253
     254  // physical falling of the player
     255
     256
     257//   this->fallVelocity += 10.0f * time + this->fallVelocity;
     258
     259
    253260  velocity *= 100;
    254261
    255262  this->shiftCoor( velocity*time );
     263
     264
     265
    256266
    257267
  • branches/single_player_map/src/world_entities/creatures/fps_player.h

    r8731 r8939  
    5151
    5252    PNode                 cameraNode;
     53
     54    float                 fallVelocity;        //!< velocity for falling down
    5355};
    5456
  • branches/single_player_map/src/world_entities/world_entity.h

    r8894 r8939  
    9494  CollisionHandle* getCollisionHandle(CREngine::CRType type) const { return this->collisionHandles[type]; }
    9595
     96  /** @returns true if this entity is standing on ground (BSP model) */
     97  bool isOnGround() const { return this->isOnGround(); }
     98  /** @param flag: marks if this entity is standing on ground */
     99  void setOnGround(bool flag) { this->bOnGround = flag; }
     100
    96101  virtual void hit(float damage);
    97102  virtual void destroy();
     
    117122
    118123  void hide() { if( this->objectListNumber != OM_DEAD) this->lastObjectListNumber = this->objectListNumber; this->toList(OM_DEAD); }
    119   void unhide() { this->toList(this->lastObjectListNumber); }
     124  void unhide() { if( this->objectListNumber != this->lastObjectListNumber) this->toList(this->lastObjectListNumber); }
    120125
    121126
     
    194199
    195200  PhysicsInterface        physicsInterface;                //!< the physics object of the WorldEntity
    196 
     201  bool                    bOnGround;                       //!< true if this entity is standing on the ground
    197202
    198203  protected:
Note: See TracChangeset for help on using the changeset viewer.