Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3228 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
Dec 20, 2004, 12:32:32 AM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: unstable - cleaned up vector.h

Location:
orxonox/trunk/src
Files:
4 edited

Legend:

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

    r3225 r3228  
    7676   bound entity's position on the track.
    7777*/
    78 void Camera::update_desired_place ()
     78void Camera::updateDesiredPlace ()
    7979{
    8080  switch(cameraMode)
     
    9090          {
    9191            bound->get_lookat (&lookat);
    92             orx->get_world()->calc_camera_pos (&lookat, &plFocus);
     92            orx->getWorld()->calcCameraPos (&lookat, &plFocus);
    9393            Quaternion *fr;
    9494            if(t < 20.0)
     
    101101               
    102102                Vector op(1.0, 0.0, 0.0);
    103                 float angle = angle_deg(op, *start);
     103                float angle = angleDeg(op, *start);
    104104                printf("angle is: %f\n", angle);
    105105
     
    144144
    145145            Vector ursp(0.0, 0.0, 0.0);
    146             desired_place.r = /*plFocus.r -*/ ursp - res->apply(r);
    147 
    148             printf("desired place is: %f, %f, %f\n", desired_place.r.x, desired_place.r.y, desired_place.r.z);
     146            desiredPlace.r = /*plFocus.r -*/ ursp - res->apply(r);
     147
     148            printf("desired place is: %f, %f, %f\n", desiredPlace.r.x, desiredPlace.r.y, desiredPlace.r.z);
    149149            //plLastBPlace = *bound->get_placement();
    150150          }
     
    153153    case SMOTH_FOLLOW:
    154154      {
    155         Placement *plBound = bound->get_placement();
     155        Placement *plBound = bound->getPlacement();
    156156        Location lcBound;
    157157        if(bound != null)
    158158          {
    159             bound->get_lookat(&lcBound);
     159            bound->getLookat(&lcBound);
    160160            Vector vDirection(0.0, 0.0, 1.0);
    161161            vDirection = plBound->w.apply(vDirection);
    162             desired_place.r = (vDirection * ((lcBound.dist-10.0)/* / l*/)) + Vector(0,0,5.0);
     162            desiredPlace.r = (vDirection * ((lcBound.dist-10.0)/* / l*/)) + Vector(0,0,5.0);
    163163          }
    164164        break;
     
    173173            Vector eclipticOffset(0.0, 0.0, 5.0);
    174174            vDirection = plBound->w.apply(vDirection);
    175             desired_place.r = plBound->r - vDirection*10 + eclipticOffset;
     175            desiredPlace.r = plBound->r - vDirection*10 + eclipticOffset;
    176176          }
    177177        break;
     
    182182      if( bound != NULL && world != NULL )
    183183        {
    184           bound->get_lookat (&lookat);
    185           world->calc_camera_pos (&lookat, &desired_place);
     184          bound->getLookat (&lookat);
     185          world->calcCameraPos (&lookat, &desiredPlace);
    186186        }
    187187      else
    188188        {
    189           desired_place.r = Vector (0,0,0);
    190           desired_place.w = Quaternion ();
     189          desiredPlace.r = Vector (0,0,0);
     190          desiredPlace.w = Quaternion ();
    191191        }
    192192      break;
     
    265265  if( plc == NULL)
    266266    {
    267       actual_place = desired_place;
     267      actualPlace = desiredPlace;
    268268      //printf("Camera|jump: camer@ %f, %f, %f\n\n", actual_place.r.x, actual_place.r.y, actual_place.r.z);
    269269    }
    270270  else
    271271    {
    272       desired_place = *plc;
    273       actual_place = *plc;
     272      desiredPlace = *plc;
     273      actualPlace = *plc;
    274274    }
    275275}
  • orxonox/trunk/src/camera.h

    r3225 r3228  
    2727  WorldEntity* bound;           //!< the WorldEntity the Camera is bound to
    2828  Placement actual_place;               //!< the Camera's current position
    29   Placement desired_place;        //!< where the Camera should be according to calculations
     29  Placement desiredPlace;        //!< where the Camera should be according to calculations
    3030  World* world;
    3131 
     
    5454  CAMERA_MODE cameraMode; //!< saves the camera mode: how the camera follows the entity
    5555 
    56   void update_desired_place ();
     56  void updateDesiredPlace ();
    5757 
    5858 public:
  • orxonox/trunk/src/vector.cc

    r3004 r3228  
    203203   \return the angle between the vectors in radians
    204204*/
    205 float angle_rad (const Vector& v1, const Vector& v2)
     205float angleRad (const Vector& v1, const Vector& v2)
    206206{
    207207  return acos( v1 * v2 / (v1.len() * v2.len()));
     
    215215   \return the angle between the vectors in degrees
    216216*/
    217 float angle_deg (const Vector& v1, const Vector& v2)
     217float angleDeg (const Vector& v1, const Vector& v2)
    218218{
    219219  float f;
     
    714714   \return the rotated vector
    715715*/
    716 Vector rotate_vector( const Vector& v, const Rotation& r)
     716Vector rotateVector( const Vector& v, const Rotation& r)
    717717{
    718718  Vector t;
     
    745745   \return the distance between the Line and the point
    746746*/
    747 float Line::distance_point (const Vector& v) const
     747float Line::distancePoint (const Vector& v) const
    748748{
    749749  Vector d = v-r;
     
    815815   \param l: a line
    816816*/
    817 Vector Plane::intersect_line (const Line& l) const
     817Vector Plane::intersectLine (const Line& l) const
    818818{
    819819  if (n.x*l.a.x+n.y*l.a.y+n.z*l.a.z == 0.0) return Vector(0,0,0);
     
    827827   \return the distance between the plane and the point (can be negative)
    828828*/
    829 float Plane::distance_point (const Vector& p) const
     829float Plane::distancePoint (const Vector& p) const
    830830{
    831831  float l = n.len();
     
    839839   \return 0 if the point is contained within the Plane, positive(negative) if the point is in the positive(negative) semi-space of the Plane
    840840*/
    841 float Plane::locate_point (const Vector& p) const
     841float Plane::locatePoint (const Vector& p) const
    842842{
    843843  return (n.dot(p) + k);
  • orxonox/trunk/src/vector.h

    r3224 r3228  
    4040};
    4141
    42 float angle_deg (const Vector& v1, const Vector& v2);
    43 float angle_rad (const Vector& v1, const Vector& v2);
     42float angleDeg (const Vector& v1, const Vector& v2);
     43float angleRad (const Vector& v1, const Vector& v2);
    4444
    4545//! Quaternion
     
    9898
    9999//!< Apply a rotation to a vector
    100 Vector rotate_vector( const Vector& v, const Rotation& r);
     100Vector rotateVector( const Vector& v, const Rotation& r);
    101101
    102102//! 3D line
     
    118118 
    119119  float distance (const Line& l) const;
    120   float distance_point (const Vector& v) const;
     120  float distancePoint (const Vector& v) const;
    121121  Vector* footpoints (const Line& l) const;
    122122  float len () const;
     
    144144  ~Plane () {}
    145145 
    146   Vector intersect_line (const Line& l) const;
    147   float distance_point (const Vector& p) const;
    148   float locate_point (const Vector& p) const;
     146  Vector intersectLine (const Line& l) const;
     147  float distancePoint (const Vector& p) const;
     148  float locatePoint (const Vector& p) const;
    149149};
    150150
Note: See TracChangeset for help on using the changeset viewer.