Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10387 in orxonox.OLD


Ignore:
Timestamp:
Jan 26, 2007, 6:22:33 PM (17 years ago)
Author:
patrick
Message:

removed the segfault for npcs, adding clouds to planets

Location:
trunk/src/world_entities
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/camera.cc

    r10379 r10387  
    6868  this->setAspectRatio(1.33f);
    6969  this->setClipRegion(.1, 10000);
    70  
     70
    7171  this->viewTopFovy = 60;
    7272  this->viewNormalFovy = 90;
  • trunk/src/world_entities/npcs/npc.cc

    r10376 r10387  
    6464
    6565  this->getWeaponManager().changeWeaponConfig(1);
    66   Weapon* wpRight = new TestGun(0);
    67   wpRight->setName("testGun Right");
    68   Weapon* wpLeft = new TestGun(1);
    69   wpLeft->setName("testGun Left");
    70 
    71   wpRight->toList( this->getOMListNumber());
    72   wpLeft->toList( this->getOMListNumber());
    73 
    74 
    75   this->addWeapon(wpLeft, 1, 0);
    76   this->addWeapon(wpRight,1 ,1);
    77 
    78   wpLeft->increaseEnergy( 100);
    79   wpRight->increaseEnergy( 100);
     66//   Weapon* wpRight = new TestGun(0);
     67//   wpRight->setName("testGun Right");
     68//   Weapon* wpLeft = new TestGun(1);
     69//   wpLeft->setName("testGun Left");
     70//
     71//   wpRight->toList( this->getOMListNumber());
     72//   wpLeft->toList( this->getOMListNumber());
     73//
     74//
     75//   this->addWeapon(wpLeft, 1, 0);
     76//   this->addWeapon(wpRight,1 ,1);
     77//
     78//   wpLeft->increaseEnergy( 100);
     79//   wpRight->increaseEnergy( 100);
    8080
    8181  this->setHealthMax(100);
    8282  this->setHealth(80);
    8383
    84   this->getWeaponManager().setSlotCount(7);
    85 
    86   this->getWeaponManager().setSlotPosition(0, Vector(-2.6, .1, -3.0));
    87   this->getWeaponManager().setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    88 
    89   this->getWeaponManager().setSlotPosition(1, Vector(-2.6, .1, 3.0));
    90   this->getWeaponManager().setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    91 
    92   this->getWeaponManager().setSlotPosition(2, Vector(-1.5, .5, -.5));
    93   this->getWeaponManager().setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0)));
    94 
    95   this->getWeaponManager().setSlotPosition(3, Vector(-1.5, .5, .5));
    96   this->getWeaponManager().setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0)));
    97 
    98   this->getWeaponManager().setSlotPosition(4, Vector(-1.5, -.5, .5));
    99   this->getWeaponManager().setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));
    100 
    101   this->getWeaponManager().setSlotPosition(5, Vector(-1.5, -.5, -.5));
    102   this->getWeaponManager().setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));
    103 
    104   this->getWeaponManager().setSlotPosition(6, Vector(-1, 0.0, 0));
    105   this->getWeaponManager().setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    106 
    107   this->getWeaponManager().getFixedTarget()->setParent(this);
    108   this->getWeaponManager().getFixedTarget()->setRelCoor(100000,0,0);
     84//   this->getWeaponManager().setSlotCount(7);
     85//
     86//   this->getWeaponManager().setSlotPosition(0, Vector(-2.6, .1, -3.0));
     87//   this->getWeaponManager().setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     88//
     89//   this->getWeaponManager().setSlotPosition(1, Vector(-2.6, .1, 3.0));
     90//   this->getWeaponManager().setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     91//
     92//   this->getWeaponManager().setSlotPosition(2, Vector(-1.5, .5, -.5));
     93//   this->getWeaponManager().setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0)));
     94//
     95//   this->getWeaponManager().setSlotPosition(3, Vector(-1.5, .5, .5));
     96//   this->getWeaponManager().setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0)));
     97//
     98//   this->getWeaponManager().setSlotPosition(4, Vector(-1.5, -.5, .5));
     99//   this->getWeaponManager().setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));
     100//
     101//   this->getWeaponManager().setSlotPosition(5, Vector(-1.5, -.5, -.5));
     102//   this->getWeaponManager().setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));
     103//
     104//   this->getWeaponManager().setSlotPosition(6, Vector(-1, 0.0, 0));
     105//   this->getWeaponManager().setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     106//
     107//   this->getWeaponManager().getFixedTarget()->setParent(this);
     108//   this->getWeaponManager().getFixedTarget()->setRelCoor(100000,0,0);
    109109
    110110}
  • trunk/src/world_entities/planet.cc

    r10114 r10387  
    4545  this->toList(OM_GROUP_01);
    4646
    47   //this->material->setIllum(20);
    48   //this->material->setAmbient(0.1, 0.1, 0.1);
     47  //this->materialPlanet->setIllum(20);
     48  //this->materialPlanet->setAmbient(0.1, 0.1, 0.1);
     49
     50  if( root != NULL)
     51    this->loadParams(root);
     52
     53  PrimitiveModel* model = new PrimitiveModel(PRIM_SPHERE, this->size, 50);
     54  this->setModel(model);
    4955
    5056
    5157
    52       //st float radius, const unsigned int loops, const unsigned int segmentsPerLoop
    53 
    54   this->loadParams(root);
    55 
    56 //   VertexArrayModel* model = new VertexArrayModel();
    57 //   model->spiralSphere(this->size, 10, 10);
    58 //   this->setModel(model);
    59 //   model->debug();
    60 //
    61   PrimitiveModel* model = new PrimitiveModel(PRIM_SPHERE, this->size, 50);
    62   this->setModel(model);
    6358}
    6459
     
    7873
    7974  LoadParam(root, "texture", this, Planet, setTexture)
    80       .describe("Sets the material on the Planet. The string must be the path relative to the data-dir, and without a trailing .jpg");
     75      .describe("Sets the materialPlanet on the Planet. The string must be the path relative to the data-dir, and without a trailing .jpg");
     76
     77  LoadParam(root, "cloud-texture", this, Planet, setCloudTexture)
     78      .describe("Sets the cloud texture of the planet");
    8179
    8280  LoadParam(root, "size", this, Planet, setSize)
     
    9189void Planet::setTexture(const std::string& textureName)
    9290{
    93   this->material.setDiffuseMap(textureName);
     91  this->materialPlanet.setDiffuseMap(textureName);
     92}
     93
     94
     95/**
     96 *  Defines which textures should be loaded onto the Planet.
     97 * @param textureName the top texture.
     98*/
     99void Planet::setCloudTexture(const std::string& textureName)
     100{
     101  this->materialCloud.setDiffuseMap(textureName);
    94102}
    95103
     
    109117void Planet::draw() const
    110118{
    111   this->material.select();
     119  this->materialPlanet.select();
    112120
    113121  WorldEntity::draw();
  • trunk/src/world_entities/planet.h

    r9869 r10387  
    2828  /** assumes jpg as input-format */
    2929  void setTexture(const std::string& textureName);
     30  void setCloudTexture(const std::string& textureName);
     31
    3032
    3133
     
    3537
    3638 private:
    37   Material        material;        //!< Materials for the Planet. sorted by number (0-5) top, bottom, left, right, front, back
    38   Texture*        texture;         //!< Textures for the CubeMap.
     39  Material        materialPlanet;  //!< Materials for the Planet. sorted by number (0-5) top, bottom, left, right, front, back
     40  Material        materialCloud;   //!< the material for the cloud surrounding the planet
     41
     42  Model*          cloudModel;      //!< the model for the cloud
     43
    3944
    4045  float           size;            //!< Size of the Planet. This should match the frustum maximum range.
Note: See TracChangeset for help on using the changeset viewer.