Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8890 in orxonox.OLD


Ignore:
Timestamp:
Jun 28, 2006, 11:47:35 PM (18 years ago)
Author:
patrick
Message:

door and weapon stuff

Location:
branches/single_player_map/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/single_player_map/src/lib/collision_detection/cd_engine.cc

    r8490 r8890  
    8484        if( likely((*entity2) != this->terrain))
    8585        {
    86           PRINTF(4)("checking object %s against %s\n", (*entity1)->getName(), (*entity2)->getName());
     86          PRINTF(5)("checking object %s (%s) against %s (%s)\n", (*entity1)->getClassName(), (*entity1)->getName(), (*entity2)->getClassName(), (*entity2)->getName());
    8787          tree = (*entity1)->getOBBTree();
    8888          if( likely(tree != NULL) && (*entity2)->getOBBTree() != NULL)
  • branches/single_player_map/src/world_entities/creatures/fps_player.cc

    r8869 r8890  
    2626#include "weapons/turret.h"
    2727#include "weapons/cannon.h"
     28#include "weapons/fps_sniper_rifle.h"
    2829
    2930#include "key_mapper.h"
     
    109110  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
    110111
    111   Weapon* wpRight = new TestGun(0);
     112  Weapon* wpRight = new FPSSniperRifle(0);
    112113  wpRight->setName("testGun Right");
    113   Weapon* wpLeft = new TestGun(1);
     114/*  Weapon* wpLeft = new TestGun(1);*/
    114115//   Weapon* wpLeft = new Turret();
    115   wpLeft->setName("testGun Left");
    116 
    117   this->addWeapon(wpLeft, 1, 0);
     116//   wpLeft->setName("testGun Left");
     117
     118//   this->addWeapon(wpLeft, 1, 0);
    118119  this->addWeapon(wpRight,1 ,1);
    119120  this->getWeaponManager().changeWeaponConfig(1);
  • branches/single_player_map/src/world_entities/door.cc

    r8886 r8890  
    5353Door::Door(const TiXmlElement* root)
    5454{
    55   this->init();
     55
     56  this->setClassID(CL_DOOR, "Door");
     57  this->scale = 1.0f;
    5658
    5759  if( root != NULL)
    5860    this->loadParams(root);
     61
     62  this->toList(OM_COMMON);
     63  this->bLocked = false;
     64
     65  this->loadMD2Texture("maps/doors.jpg");
     66  this->loadModel("models/creatures/doors.md2", this->scale);
     67  this->setAnimation(DOOR_CLOSE, MD2_ANIM_ONCE);
    5968}
    6069
     
    6473
    6574
    66 
    67 void Door::init()
    68 {
    69   this->setClassID(CL_DOOR, "Door");
    70   this->toList(OM_COMMON);
    71 
    72   this->bLocked = false;
    73 
    74 
    75   this->loadMD2Texture("maps/doors.jpg");
    76   this->loadModel("models/creatures/doors.md2", 1.0);
    77   this->setAnimation(DOOR_CLOSE, MD2_ANIM_ONCE);
    78 }
    7975
    8076/**
     
    8682  WorldEntity::loadParams(root);
    8783
    88   LoadParam(root, "", this, Door, setActionRadius)
     84  LoadParam(root, "action-radius", this, Door, setActionRadius)
    8985      .describe("sets the action radius of the door")
    9086      .defaultValues(3.0);
     87  LoadParam(root, "scale", this, Door, setScale)
     88      .describe("sets the scale of the door")
     89      .defaultValues(1.0);
    9190}
    9291
     
    115114    ((InteractiveModel*)this->getModel(0))->tick(time);
    116115
    117   this->checkOpen();
     116  if( this->checkOpen() && !this->bOpen)
     117    this->open();
     118  else if( bOpen)
     119    this->close();
     120
    118121}
    119122
     
    128131
    129132  this->setAnimation(DOOR_OPEN, MD2_ANIM_ONCE);
    130 
     133  this->bOpen = true;
    131134}
    132135
     
    137140void Door::close()
    138141{
    139 
     142  this->setAnimation(DOOR_CLOSE, MD2_ANIM_ONCE);
     143  this->bOpen = false;
    140144}
    141145
  • branches/single_player_map/src/world_entities/door.h

    r8881 r8890  
    2626    virtual ~Door ();
    2727
    28     void init();
    2928    virtual void loadParams(const TiXmlElement* root);
    3029
    3130    void setActionRadius(float radius) { this->actionRadius = radius; }
     31    void setScale(float scale) { this->scale = scale; }
    3232
    3333    void open();
     
    5151    bool           bLocked;           //!< true if this door is locked
    5252    float          actionRadius;      //!< action radius
     53    float          scale;             //!< the scale of the model
    5354
    5455    static sAnim   animationList[2];  //!< list of the animations
     56
    5557
    5658};
  • branches/single_player_map/src/world_entities/npcs/generic_npc.h

    r8824 r8890  
    8484  void destroy();
    8585
     86
    8687 private:
    8788   OrxSound::SoundSource                   soundSource;
  • branches/single_player_map/src/world_entities/weapons/fps_sniper_rifle.cc

    r8871 r8890  
    7676//  this->model = (Model*)ResourceManager::getInstance()->load("models/guns/test_gun.obj", OBJ, RP_CAMPAIGN);
    7777
    78   this->loadModel("models/guns/test_gun.obj");
     78  this->loadModel("models/guns/fps_sniper_rifle.obj");
    7979
    8080  this->setStateDuration(WS_SHOOTING, .1);
  • branches/single_player_map/src/world_entities/weapons/fps_sniper_rifle.h

    r8870 r8890  
    2121
    2222
    23 #ifndef _TEST_GUN_H
    24 #define _TEST_GUN_H
     23#ifndef _FPS_SNIPER_RIFLE_H
     24#define _FPS_SNIPER_RIFLE_H
    2525
    2626#include "weapon.h"
     
    5555
    5656  };
    57 #endif /* _TEST_GUN_H */
     57#endif /* _FPS_SNIPER_RIFLE_H */
Note: See TracChangeset for help on using the changeset viewer.