Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9098 in orxonox.OLD for branches


Ignore:
Timestamp:
Jul 4, 2006, 3:41:46 AM (18 years ago)
Author:
bensch
Message:

orxonox/presentation: better camera-control

Location:
branches/presentation/src/world_entities/space_ships
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/world_entities/space_ships/spacecraft_2d.cc

    r9097 r9098  
    205205  LoadParam(root, "travel-speed", this, Spacecraft2D, setTravelSpeed);
    206206  LoadParam(root, "travel-height", this, Spacecraft2D, setTravelHeight);
     207  LoadParam(root, "travel-distance", this, Spacecraft2D, setTravelDistance);
    207208}
    208209
     
    225226}
    226227
     228
     229void Spacecraft2D::setTravelDistance(const Vector2D& distance)
     230{
     231  this->travelDistance = distance;
     232}
     233
     234void Spacecraft2D::setTravelDistance(float x, float y)
     235{
     236  this->setTravelDistance(Vector2D(x, y));
     237}
    227238
    228239
     
    255266        State::getCameraNode()->setRelCoorSoft(-10, 0,0);
    256267        State::getCameraTargetNode()->setParentSoft(&this->cameraNode);
     268        State::getCameraTargetNode()->setRelCoorSoft(100, 0,0);
     269
    257270      }
    258271      break;
     
    274287        State::getCameraNode()->setRelCoorSoft(-3, 50,0);
    275288        State::getCameraTargetNode()->setParentSoft(this->travelNode);
     289        State::getCameraTargetNode()->setRelCoorSoft(0,0,0);
    276290
    277291
  • branches/presentation/src/world_entities/space_ships/spacecraft_2d.h

    r9097 r9098  
    2525    void setTravelSpeed(float travelSpeed);
    2626    void setTravelHeight(float travelHeight);
     27    void setTravelDistance(const Vector2D& distance);
     28    void setTravelDistance(float x, float y);
    2729
    2830
     
    7072    float                 travelSpeed;        //!< the current speed of the Hove (to make soft movement)
    7173
     74    Vector2D              travelDistance;     //!< Travel-Distance away from the TravelNode.
     75
    7276    /// Camera
    7377    PNode                 cameraNode;
Note: See TracChangeset for help on using the changeset viewer.