Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3595 in orxonox.OLD


Ignore:
Timestamp:
Mar 17, 2005, 5:44:56 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: deleted the UPOINTCURVE was very bad.
also deleted matrix.cc because of some license problems, and we do not need all the functions (and it can't even work with the vector-class

Location:
orxonox/trunk/src
Files:
2 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/Makefile.am

    r3580 r3595  
    6464                 lib/util/list.cc \
    6565                 lib/math/vector.cc \
    66                  lib/math/matrix.cc \
    6766                 lib/math/curve.cc \
    6867                 glmenu/glmenu_imagescreen.cc
     
    113112                 lib/util/ini_parser.h \
    114113                 lib/math/vector.h \
    115                  lib/math/matrix.h \
    116114                 lib/math/curve.h \
    117115                 glmenu/glmenu_imagescreen.h
  • orxonox/trunk/src/Makefile.in

    r3580 r3595  
    6666        material.$(OBJEXT) texture.$(OBJEXT) base_entity.$(OBJEXT) \
    6767        base_object.$(OBJEXT) ini_parser.$(OBJEXT) list.$(OBJEXT) \
    68         vector.$(OBJEXT) matrix.$(OBJEXT) curve.$(OBJEXT) \
    69         glmenu_imagescreen.$(OBJEXT)
     68        vector.$(OBJEXT) curve.$(OBJEXT) glmenu_imagescreen.$(OBJEXT)
    7069orxonox_OBJECTS = $(am_orxonox_OBJECTS)
    7170orxonox_LDADD = $(LDADD)
     
    8685@AMDEP_TRUE@    ./$(DEPDIR)/ini_parser.Po ./$(DEPDIR)/keynames.Po \
    8786@AMDEP_TRUE@    ./$(DEPDIR)/light.Po ./$(DEPDIR)/list.Po \
    88 @AMDEP_TRUE@    ./$(DEPDIR)/material.Po ./$(DEPDIR)/matrix.Po \
    89 @AMDEP_TRUE@    ./$(DEPDIR)/model.Po ./$(DEPDIR)/null_parent.Po \
    90 @AMDEP_TRUE@    ./$(DEPDIR)/objModel.Po ./$(DEPDIR)/orxonox.Po \
    91 @AMDEP_TRUE@    ./$(DEPDIR)/p_node.Po ./$(DEPDIR)/player.Po \
    92 @AMDEP_TRUE@    ./$(DEPDIR)/primitive.Po ./$(DEPDIR)/projectile.Po \
     87@AMDEP_TRUE@    ./$(DEPDIR)/material.Po ./$(DEPDIR)/model.Po \
     88@AMDEP_TRUE@    ./$(DEPDIR)/null_parent.Po ./$(DEPDIR)/objModel.Po \
     89@AMDEP_TRUE@    ./$(DEPDIR)/orxonox.Po ./$(DEPDIR)/p_node.Po \
     90@AMDEP_TRUE@    ./$(DEPDIR)/player.Po ./$(DEPDIR)/primitive.Po \
     91@AMDEP_TRUE@    ./$(DEPDIR)/projectile.Po \
    9392@AMDEP_TRUE@    ./$(DEPDIR)/simple_animation.Po \
    9493@AMDEP_TRUE@    ./$(DEPDIR)/skysphere.Po \
     
    265264                 lib/util/list.cc \
    266265                 lib/math/vector.cc \
    267                  lib/math/matrix.cc \
    268266                 lib/math/curve.cc \
    269267                 glmenu/glmenu_imagescreen.cc
     
    314312                 lib/util/ini_parser.h \
    315313                 lib/math/vector.h \
    316                  lib/math/matrix.h \
    317314                 lib/math/curve.h \
    318315                 glmenu/glmenu_imagescreen.h
     
    410407@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@
    411408@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/material.Po@am__quote@
    412 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/matrix.Po@am__quote@
    413409@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/model.Po@am__quote@
    414410@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/null_parent.Po@am__quote@
     
    894890@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    895891@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o vector.obj `if test -f 'lib/math/vector.cc'; then $(CYGPATH_W) 'lib/math/vector.cc'; else $(CYGPATH_W) '$(srcdir)/lib/math/vector.cc'; fi`
    896 
    897 matrix.o: lib/math/matrix.cc
    898 @am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT matrix.o -MD -MP -MF "$(DEPDIR)/matrix.Tpo" -c -o matrix.o `test -f 'lib/math/matrix.cc' || echo '$(srcdir)/'`lib/math/matrix.cc; \
    899 @am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/matrix.Tpo" "$(DEPDIR)/matrix.Po"; else rm -f "$(DEPDIR)/matrix.Tpo"; exit 1; fi
    900 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/math/matrix.cc' object='matrix.o' libtool=no @AMDEPBACKSLASH@
    901 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/matrix.Po' tmpdepfile='$(DEPDIR)/matrix.TPo' @AMDEPBACKSLASH@
    902 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    903 @am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o matrix.o `test -f 'lib/math/matrix.cc' || echo '$(srcdir)/'`lib/math/matrix.cc
    904 
    905 matrix.obj: lib/math/matrix.cc
    906 @am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT matrix.obj -MD -MP -MF "$(DEPDIR)/matrix.Tpo" -c -o matrix.obj `if test -f 'lib/math/matrix.cc'; then $(CYGPATH_W) 'lib/math/matrix.cc'; else $(CYGPATH_W) '$(srcdir)/lib/math/matrix.cc'; fi`; \
    907 @am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/matrix.Tpo" "$(DEPDIR)/matrix.Po"; else rm -f "$(DEPDIR)/matrix.Tpo"; exit 1; fi
    908 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='lib/math/matrix.cc' object='matrix.obj' libtool=no @AMDEPBACKSLASH@
    909 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/matrix.Po' tmpdepfile='$(DEPDIR)/matrix.TPo' @AMDEPBACKSLASH@
    910 @AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    911 @am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o matrix.obj `if test -f 'lib/math/matrix.cc'; then $(CYGPATH_W) 'lib/math/matrix.cc'; else $(CYGPATH_W) '$(srcdir)/lib/math/matrix.cc'; fi`
    912892
    913893curve.o: lib/math/curve.cc
  • orxonox/trunk/src/lib/math/curve.cc

    r3593 r3595  
    2626
    2727#include "curve.h"
    28 #include "matrix.h"
     28
    2929#include "debug.h"
    3030
     
    285285  return curvePoint;
    286286}
    287 
    288 
    289 
    290 ///////////////////////////////////
    291 //// Uniform Point curve  /////////
    292 ///////////////////////////////////
    293 /**
    294    \brief Creates a new UPointCurve
    295 */
    296 UPointCurve::UPointCurve (void)
    297 {
    298   this->derivation = 0;
    299 }
    300 
    301 /**
    302    \brief Creates a new UPointCurve-Derivation-Curve of deriavation'th degree
    303 */
    304 UPointCurve::UPointCurve (int derivation)
    305 {
    306   this->derivation = derivation;
    307   dirCurve=NULL;
    308 }
    309 
    310 /**
    311    \brief Deletes a UPointCurve.
    312 
    313    It does this by freeing all the space taken over from the nodes
    314 */
    315 UPointCurve::~UPointCurve(void)
    316 {
    317   PathNode* tmpNode;
    318   currentNode = firstNode;
    319   while (tmpNode != 0)
    320     {
    321       tmpNode = currentNode;
    322       currentNode = currentNode->next;
    323       delete tmpNode;
    324     }
    325   if (dirCurve)
    326     delete dirCurve;
    327 }
    328 
    329 /**
    330    \brief Rebuilds a UPointCurve
    331    
    332    \todo very bad algorithm
    333 */
    334 void UPointCurve::rebuild(void)
    335 {
    336   // rebuilding the Curve itself
    337   PathNode* tmpNode = this->firstNode;
    338   int i=0;
    339   Matrix xTmpMat = Matrix(this->nodeCount, this->nodeCount);
    340   Matrix yTmpMat = Matrix(this->nodeCount, this->nodeCount);
    341   Matrix zTmpMat = Matrix(this->nodeCount, this->nodeCount);
    342   Matrix xValMat = Matrix(this->nodeCount, 3);
    343   Matrix yValMat = Matrix(this->nodeCount, 3);
    344   Matrix zValMat = Matrix(this->nodeCount, 3);
    345   while(tmpNode)
    346     {
    347       Vector fac = Vector(1,1,1);
    348       for (int j = 0; j < this->nodeCount; j++)
    349         {
    350           xTmpMat(i,j) = fac.x; fac.x *= (float)i/(float)this->nodeCount;//tmpNode->position.x;
    351           yTmpMat(i,j) = fac.y; fac.y *= (float)i/(float)this->nodeCount;//tmpNode->position.y;
    352           zTmpMat(i,j) = fac.z; fac.z *= (float)i/(float)this->nodeCount;//tmpNode->position.z;
    353         }
    354       xValMat(i,0) = tmpNode->position.x;
    355       yValMat(i,0) = tmpNode->position.y;
    356       zValMat(i,0) = tmpNode->position.z;
    357       ++i;
    358       tmpNode = tmpNode->next;
    359     }
    360   tmpNode = this->firstNode;
    361   xValMat = xTmpMat.Inv() *= xValMat;
    362   yValMat = yTmpMat.Inv() *= yValMat;
    363   zValMat = zTmpMat.Inv() *= zValMat;
    364   i = 0;
    365   while(tmpNode)
    366     {
    367       tmpNode->vFactor.x = xValMat(i,0);
    368       tmpNode->vFactor.y = yValMat(i,0);
    369       tmpNode->vFactor.z = zValMat(i,0);
    370 
    371       i++;
    372       tmpNode = tmpNode->next;
    373     }
    374 }
    375 
    376 /**
    377    \brief calculates the Position on the curve
    378    \param t The position on the Curve (0<=t<=1)
    379    \return the Position on the Path
    380 */
    381 Vector UPointCurve::calcPos(float t)
    382 {
    383   PathNode* tmpNode = firstNode;
    384   Vector ret = Vector(0.0,0.0,0.0);
    385   float factor = 1.0;
    386   while(tmpNode)
    387     {
    388       ret.x += tmpNode->vFactor.x * factor;
    389       ret.y += tmpNode->vFactor.y * factor;
    390       ret.z += tmpNode->vFactor.z * factor;
    391       factor *= t;
    392 
    393       tmpNode = tmpNode->next;
    394     }
    395   return ret;
    396 }
    397 
    398 /**
    399    \brief Calulates the direction of the Curve at time t.
    400    \param The time at which to evaluate the curve.
    401    \returns The vvaluated Vector.
    402 */
    403 Vector UPointCurve::calcDir (float t)
    404 {
    405   PathNode* tmpNode = firstNode;
    406   Vector ret = Vector(0.0,0.0,0.0);
    407   float factor = 1.0/t;
    408   int k=0;
    409   while(tmpNode)
    410     {
    411       ret.x += tmpNode->vFactor.x * factor *k;
    412       ret.y += tmpNode->vFactor.y * factor *k;
    413       ret.z += tmpNode->vFactor.z * factor *k;
    414       factor *= t;
    415       k++;
    416       tmpNode = tmpNode->next;
    417     }
    418   ret.normalize();
    419   return ret;
    420 }
    421 
    422 Vector UPointCurve::calcAcc (float t)
    423 {
    424 }
    425 
    426 /**
    427    \brief Calculates the Quaternion needed for our rotations
    428    \param t The time at which to evaluate the cuve.
    429    \returns The evaluated Quaternion.
    430 */
    431 Quaternion UPointCurve::calcQuat (float t)
    432 {
    433   return Quaternion (calcDir(t), Vector(0,0,1));
    434 }
    435 
    436 
    437 /**
    438   \brief returns the Position of the point calculated on the Curve
    439   \return a Vector to the calculated position
    440 */
    441 Vector UPointCurve::getPos(void) const
    442 {
    443   return curvePoint;
    444 }
  • orxonox/trunk/src/lib/math/curve.h

    r3588 r3595  
    1313
    1414//! An Enumerator that defines what sort of Curves are availible
    15 enum CurveType {BEZIERCURVE, UPOINTCURVE};
     15enum CurveType {BEZIERCURVE};
    1616
    1717
     
    9393};
    9494
    95 //! Uniform Point Curve-class
    96 /**
    97    A UPoint Curve is a A Curve, that flows through all the nodes given it.
    98    The Algorithm to buid the curve is rather slow, but Painting and tracing along the curve has high speed, so do not change this curve during the Game.
    99 
    100    This Curve is very erattic, so i do not recommend to use it.
    101 */
    102 class UPointCurve : public Curve
    103 {
    104  private:
    105   void rebuild(void);
    106  public:
    107   UPointCurve(void);
    108   UPointCurve(int derivation);
    109   ~UPointCurve(void);
    110 
    111   Vector calcPos(float t);
    112   Vector calcDir(float t);
    113   Vector calcAcc(float t);
    114   Quaternion calcQuat(float t);
    115  
    116   Vector getPos(void) const;
    117 };
    118 
    11995#endif /* _CURVE_H */
  • orxonox/trunk/src/track_manager.cc

    r3594 r3595  
    420420      trackElem->curve = new BezierCurve();
    421421      break;
    422     case UPOINTCURVE:
    423       trackElem->curve = new UPointCurve();
    424       break;
     422
    425423    }
    426424}
Note: See TracChangeset for help on using the changeset viewer.