Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10368 in orxonox.OLD for trunk/src/lib


Ignore:
Timestamp:
Jan 25, 2007, 2:18:07 PM (18 years ago)
Author:
patrick
Message:

merged the branche playability into the trunk

Location:
trunk
Files:
10 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1010autom4te.cache
        1111aclocal.m4
         12tags
         13test.bmp
         14config.sub
         15config.guess
         16OrxonoxPlayability.kdevses
         17OrxonoxPlayability.kdevelop.pcs
  • trunk/src/lib/coord/p_node.h

    r9869 r10368  
    9898  inline const Vector& getRelCoor () const { return this->prevRelCoordinate; };
    9999  /** @returns the Relative Coordinate Destination */
    100 inline const Vector& getRelCoorSoft2D() const { return (this->toCoordinate)? *this->toCoordinate : this->relCoordinate; };
     100  inline const Vector& getRelCoorSoft2D() const { return (this->toCoordinate)? *this->toCoordinate : this->relCoordinate; };
    101101  void setAbsCoor (const Vector& absCoord);
    102102  void setAbsCoor (float x, float y, float z);
     
    133133  inline const Quaternion& getRelDir () const { return this->prevRelDirection; };
    134134  /** @returns the Relative Directional Destination */
    135 inline const Quaternion& getRelDirSoft2D() const { return (this->toDirection)? *this->toDirection : this->relDirection; };
     135  inline const Quaternion& getRelDirSoft2D() const { return (this->toDirection)? *this->toDirection : this->relDirection; };
    136136  /** @returns a Vector pointing into the relative Direction */
    137137  inline Vector getRelDirV() const { return this->prevRelDirection.apply(Vector(0,1,0)); };
  • trunk/src/lib/graphics/importer/vertex_array_model.cc

    r9869 r10368  
    260260                            ((float)j - (float)resolutionY/2.0)/(float)resolutionY * sizeY);
    261261          this->addNormal(0.0, 1, 0.0);
    262           this->addTexCoor((float)i/(float)resolutionX, (float)j/(float)resolutionY);
     262          this->addTexCoor((float)i/(float)(resolutionY-1), (float)j/(float)(resolutionX-1));
    263263          this->addColor(1.0, 1.0, 1.0);
    264264        }
  • trunk/src/lib/gui/gl/glgui_bar.cc

    r9869 r10368  
    7171
    7272    this->_value = value;
    73     this->_frontRect.setSize((this->getSizeX2D() - borderLeft() - borderRight()) * (_value -_minimum)/ (_minimum + _maximum)
     73    this->_frontRect.setSize((this->getSizeX2D() - borderLeft() - borderRight()) * (_value - _minimum) / (_maximum -_minimum)
    7474        ,this->getSizeY2D() - borderTop() - borderBottom());
    7575  }
     
    9999
    100100    this->_frontRect.setTopLeft(borderLeft(), borderTop());
    101     this->_frontRect.setSize((this->getSizeX2D() - borderLeft() - borderRight()) * (_value -_minimum)/ (_minimum + _maximum)
    102                              ,this->getSizeY2D() - borderTop() - borderBottom());
     101    this->_frontRect.setSize((this->getSizeX2D() - borderLeft() - borderRight()) * (_value - _minimum) / (_maximum -_minimum)
     102        ,this->getSizeY2D() - borderTop() - borderBottom());
    103103
    104104  }
  • trunk/src/lib/gui/gl/glgui_box.cc

    r9869 r10368  
    1818#include "glgui_box.h"
    1919#include <cassert>
     20#include <iostream>
    2021#include "debug.h"
     22#include "network_log.h"
     23
    2124
    2225namespace OrxGui
     
    177180  void GLGuiBox::resize()
    178181  {
    179     if (orientation() == OrxGui::Vertical)
     182    if (this->orientation() == OrxGui::Vertical)
    180183    {
    181184      float height = borderTop();
     
    186189      for (widget = this->_children.begin(); widget != this->_children.end(); ++widget)
    187190      {
    188         (*widget)->setRelCoor2D(borderLeft(), height);
    189         height += (*widget)->getSizeY2D();
    190         width = fmax(width, (*widget)->getSizeX2D());
     191        //float radDir = (*widget)->getAbsDir2D() * 2 * M_PI / 360;
     192        //float realSizeX = fabsf((*widget)->getSizeX2D() * cosf(radDir)) + fabsf((*widget)->getSizeY2D() * sinf(radDir));
     193        //float realSizeY = fabsf((*widget)->getSizeX2D() * sinf(radDir)) + fabsf((*widget)->getSizeY2D() * cosf(radDir));
     194        float realSizeX, realSizeY;
     195        int angleAbs = (int)(*widget)->getAbsDir2D();
     196        int angleRel = (int)(*widget)->getRelDir2D();
     197        //std::cout << "absangle: " << angleAbs << ", relangle: " << angleRel << '\n';
     198        if ((*widget)->getAbsDir2D() == 0 || (*widget)->getAbsDir2D() == 180)
     199        {
     200          realSizeX = (*widget)->getSizeX2D();
     201          realSizeY = (*widget)->getSizeY2D();
     202          //std::cout<<"box vertical, widget 0or180";
     203        }
     204        else if ((*widget)->getAbsDir2D() == 90 || (*widget)->getAbsDir2D() == 270)
     205        {
     206          realSizeX = (*widget)->getSizeY2D();
     207          realSizeY = (*widget)->getSizeX2D();
     208          //std::cout<<"box vertical, widget 90or270";
     209        }
     210
     211        (*widget)->setRelCoor2D(borderLeft(), height + borderTop());
     212        height += realSizeY;
     213        width = fmax(width, realSizeX);
    191214      }
    192215
     
    205228      for (widget = this->_children.begin(); widget != this->_children.end(); ++widget)
    206229      {
     230        //float radDir = (*widget)->getAbsDir2D() * 2 * M_PI / 360;
     231        //std::cout << "size X: " << (*widget)->getSizeX2D() << "size Y: " << (*widget)->getSizeY2D() << '\n';
     232        //float realSizeX = fabsf((*widget)->getSizeX2D() * cosf(radDir)) + fabsf((*widget)->getSizeY2D() * sinf(radDir));
     233        //float realSizeY = fabsf((*widget)->getSizeX2D() * sinf(radDir)) + fabsf((*widget)->getSizeY2D() * cosf(radDir));
     234        float realSizeX, realSizeY;
     235        int angleAbs = (int)(*widget)->getAbsDir2D();
     236        int angleRel = (int)(*widget)->getRelDir2D();
     237        //std::cout << "absangle: " << angleAbs << ", relangle: " << angleRel << '\n';
     238        if ((*widget)->getAbsDir2D() == 0 || (*widget)->getAbsDir2D() == 180)
     239        {
     240          realSizeX = (*widget)->getSizeX2D();
     241          realSizeY = (*widget)->getSizeY2D();
     242          //std::cout<<"box horicontal, widget 0or180";
     243        }
     244        else if ((*widget)->getAbsDir2D() == 90 || (*widget)->getAbsDir2D() == 270)
     245        {
     246          realSizeX = (*widget)->getSizeY2D();
     247          realSizeY = (*widget)->getSizeX2D();
     248          //std::cout<<"box horicontal, widget 90or270";
     249        }
     250
    207251        (*widget)->setRelCoor2D(width, borderTop());
    208         height = fmax(height, (*widget)->getSizeY2D());
    209         width += (*widget)->getSizeX2D();
     252        height = fmax(height, realSizeY);
     253        width += realSizeX;
    210254      }
    211255
  • trunk/src/lib/gui/gl/glgui_widget.cc

    r10317 r10368  
    915915  }
    916916
     917  void GLGuiWidget::beginDraw() const
     918  {
     919    glPushMatrix();
     920    glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0);
     921    glRotatef(this->getAbsDir2D(), 0, 0, 1);
     922  }
     923
    917924
    918925}
  • trunk/src/lib/gui/gl/glgui_widget.h

    r9869 r10368  
    244244
    245245    /// RENDERING
    246     inline void beginDraw() const { glPushMatrix(); glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0); };
     246    void beginDraw() const;
    247247    inline void endDraw() const { glPopMatrix(); };
    248248
  • trunk/src/lib/math/curve.cc

    r9110 r10368  
    142142    tmpNode = tmpNode->next;
    143143  return tmpNode->position;
     144}
     145
     146/**
     147 * This function returns an approximation of the length of the curve
     148 *
     149*/
     150float Curve::getLength()
     151{
     152      float length = 0;
     153      PathNode* tmpNode = this->firstNode;
     154      for(int i = 1; i < this->nodeCount; i++)
     155      {
     156              length += Vector(tmpNode->next->position - tmpNode->position).len();
     157      }
     158      return length;
    144159}
    145160
     
    273288Vector BezierCurve::calcDir (float t)
    274289{
    275   return this->dirCurve->calcPos(t);
     290  return this->calcPos(t + 0.01) - this->calcPos(t);
     291  //return this->dirCurve->calcPos(t);
    276292}
    277293
  • trunk/src/lib/math/curve.h

    r6616 r10368  
    4747  /** @returns the directional Curve */
    4848  Curve* getDirCurve() const { return this->dirCurve; };
     49  float getLength();
    4950
    5051  /** @param t the value on the curve [0-1] @returns Vector to the position */
  • trunk/src/lib/util/loading/fast_factory.cc

    r9869 r10368  
    157157void FastFactory::flush(bool hardFLUSH)
    158158{
     159hardFLUSH = false; // HACK
    159160  FastObjectMember* tmpMember = this->deadList, *delMember = NULL;
    160161  while (tmpMember != NULL)
Note: See TracChangeset for help on using the changeset viewer.