Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4992 in orxonox.OLD for orxonox/trunk/src/world_entities


Ignore:
Timestamp:
Aug 13, 2005, 10:02:40 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: optimizations

Location:
orxonox/trunk/src/world_entities
Files:
2 edited

Legend:

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

    r4989 r4992  
    9898
    9999/**
    100   \brief Sets a new clipping region
    101 * @param nearClip The near clip plane
    102 * @param farClip The far clip plane
     100 * Sets a new clipping region
     101 * @param nearClip The near clip plane
     102 * @param farClip The far clip plane
    103103*/
    104104void Camera::setClipRegion(float nearClip, float farClip)
     
    119119    case VIEW_NORMAL:
    120120      this->toFovy = 60.0;
    121       this->setRelCoorSoft(Vector(-10, 5, 0));
    122       this->target->setRelCoorSoft(Vector(0,0,0));
     121      this->softReparent("TrackNode");
     122      this->target->softReparent("TrackNode");
     123      this->setRelCoorSoft(-10, 5, 0);
     124      this->target->setRelCoorSoft(0,0,0);
    123125      break;
    124126    case VIEW_BEHIND:
     
    131133      else
    132134        this->target->softReparent("Player");
     135      this->getParent()->debug(0);
    133136
    134137//      this->setParent("main-Turret");
     
    138141      break;
    139142    case VIEW_FRONT:
    140       this->toFovy = 95.0;
    141       this->setRelCoorSoft(Vector(10, 2, 0));
    142       this->target->setRelCoorSoft(Vector(0,0,0));
     143      this->toFovy = 120.0;
     144      //this->softReparent("Player");
     145      this->target->softReparent("Player");
     146      this->setRelCoorSoft(4, 0, 0);
     147      this->target->setRelCoorSoft(10,0,0);
    143148      break;
    144149    case VIEW_LEFT:
    145150      this->toFovy = 90;
    146       this->setRelCoorSoft(Vector(0, 1, -10));
    147       this->target->setRelCoorSoft(Vector(0,0,0));
     151      this->softReparent("TrackNode");
     152      this->target->softReparent("TrackNode");
     153      this->setRelCoorSoft(0, 1, -10, .5);
     154      this->target->setRelCoorSoft(0,0,0);
    148155      break;
    149156    case VIEW_RIGHT:
    150157      this->toFovy = 90;
     158      this->softReparent("TrackNode");
     159      this->target->softReparent("TrackNode");
    151160      this->setRelCoorSoft(Vector(0, 1, 10));
    152       this->target->setRelCoorSoft(Vector(0,0,0));
     161      this->target->setRelCoorSoft(0,0,0);
    153162      break;
    154163    case VIEW_TOP:
    155164      this->toFovy= 120;
     165      this->softReparent("TrackNode");
     166      this->target->softReparent("TrackNode");
    156167      this->setRelCoorSoft(Vector(0, 10, 0));
    157       this->target->setRelCoorSoft(Vector(0,0,0));
     168      this->target->setRelCoorSoft(0,0,0);
    158169    }
    159170}
     
    169180  if (tmpFovy > .001)
    170181    this->fovy += (this->toFovy - this->fovy) * dt;
     182
     183  this->getParent()->debug(2);
     184  //this->debug(1);
     185  //this->target->debug(1);
    171186}
    172187
  • orxonox/trunk/src/world_entities/weapons/weapon_manager.cc

    r4972 r4992  
    7676    this->currentSlotConfig[i].currentWeapon = NULL;
    7777    this->currentSlotConfig[i].nextWeapon = NULL;
     78
     79    // NAMING
     80    char* tmpName;
     81    if (this->getName())
     82    {
     83      tmpName = new char[strlen(this->getName()) + 10];
     84      sprintf(tmpName, "%s_slot%d", this->getName(), i);
     85    }
     86    else
     87    {
     88      tmpName = new char[30];
     89      sprintf(tmpName, "WeaponMan_slot%d", i);
     90    }
     91    this->currentSlotConfig[i].position.setName(tmpName);
     92    delete tmpName;
    7893  }
    7994
     
    131146}
    132147
     148/**
     149 * sets the Parent of the WeaponManager.
     150 * @param parent the parent of the WeaponManager
     151 *
     152 * this is used, to identify to which ship/man/whatever this WeaponManager is connected.
     153 * also all the Slots will be subconnected to this parent.
     154 */
    133155void WeaponManager::setParent(PNode* parent)
    134156{
Note: See TracChangeset for help on using the changeset viewer.