Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 28, 2006, 5:33:20 PM (19 years ago)
Author:
patrick
Message:

collision reaction stuff

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

Legend:

Unmodified
Added
Removed
  • branches/single_player_map/src/world_entities/door.cc

    r8875 r8876  
    6767  WorldEntity::loadParams(root);
    6868
    69 //   LoadParam(root, "", this, Door, set)
    70 //       .describe("sets the animation of the md2 model")
    71 //       .defaultValues(1);
     69  LoadParam(root, "", this, Door, setActionRadius)
     70      .describe("sets the action radius of the door")
     71      .defaultValues(1);
    7272
    7373}
    7474
    7575
    76 void  Door::setAnim(int animationIndex, int animPlaybackMode)
     76void  Door::setAnimation(int animationIndex, int animPlaybackMode)
    7777{
    7878  if( likely(this->getModel(0) != NULL))
     
    8686    ((InteractiveModel*)this->getModel(0))->tick(time);
    8787
     88
     89}
     90
     91
     92/**
     93 * open the door
     94 */
     95void Door::open()
     96{
     97  if( this->bLocked)
     98    return;
     99
     100//   this->setAnimation();
     101
     102}
     103
     104
     105/**
     106 * close the door
     107 */
     108void Door::close()
     109{
    88110
    89111}
  • branches/single_player_map/src/world_entities/door.h

    r8875 r8876  
    1818    virtual void loadParams(const TiXmlElement* root);
    1919
    20     void setAnim(int animationIndex, int animPlaybackMode);
    2120    void setActionRadius(float radius) { this->actionRadius = radius; }
    2221
     
    2625    void close();
    2726
     27    void lock() { this->bLocked = true; }
     28    void unlock() { this->bLocked = false; }
     29    bool isLocked() const { return this->bLocked; }
     30
     31
    2832  private:
    2933    bool checkOpen();
     34    void setAnimation(int animationIndex, int animPlaybackMode);
     35
    3036
    3137  private:
    3238    bool           bOpen;             //!< true if the door is open
     39    bool           bLocked;           //!< true if this door is locked
    3340    float          actionRadius;      //!< action radius
     41
    3442
    3543};
Note: See TracChangeset for help on using the changeset viewer.