Changeset 3319 in orxonox.OLD for orxonox/branches
- Timestamp:
- Jan 3, 2005, 12:23:08 PM (20 years ago)
- Location:
- orxonox/branches/parenting
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/parenting/configure
r3240 r3319 1 1 #! /bin/sh 2 2 # Guess values for system-dependent variables and create Makefiles. 3 # Generated by GNU Autoconf 2.59 for orxonox 2.0.1-pre-alpha.3 # Generated by GNU Autoconf 2.59 for orxonox 0.2.1-pre-alpha. 4 4 # 5 5 # Report bugs to <orxonox-dev at mail.datacore.ch>. … … 270 270 PACKAGE_NAME='orxonox' 271 271 PACKAGE_TARNAME='orxonox' 272 PACKAGE_VERSION=' 2.0.1-pre-alpha'273 PACKAGE_STRING='orxonox 2.0.1-pre-alpha'272 PACKAGE_VERSION='0.2.1-pre-alpha' 273 PACKAGE_STRING='orxonox 0.2.1-pre-alpha' 274 274 PACKAGE_BUGREPORT='orxonox-dev at mail.datacore.ch' 275 275 … … 789 789 # This message is too long to be a string in the A/UX 3.1 sh. 790 790 cat <<_ACEOF 791 \`configure' configures orxonox 2.0.1-pre-alpha to adapt to many kinds of systems.791 \`configure' configures orxonox 0.2.1-pre-alpha to adapt to many kinds of systems. 792 792 793 793 Usage: $0 [OPTION]... [VAR=VALUE]... … … 856 856 if test -n "$ac_init_help"; then 857 857 case $ac_init_help in 858 short | recursive ) echo "Configuration of orxonox 2.0.1-pre-alpha:";;858 short | recursive ) echo "Configuration of orxonox 0.2.1-pre-alpha:";; 859 859 esac 860 860 cat <<\_ACEOF … … 984 984 if $ac_init_version; then 985 985 cat <<\_ACEOF 986 orxonox configure 2.0.1-pre-alpha986 orxonox configure 0.2.1-pre-alpha 987 987 generated by GNU Autoconf 2.59 988 988 … … 998 998 running configure, to aid debugging if configure makes a mistake. 999 999 1000 It was created by orxonox $as_me 2.0.1-pre-alpha, which was1000 It was created by orxonox $as_me 0.2.1-pre-alpha, which was 1001 1001 generated by GNU Autoconf 2.59. Invocation command line was 1002 1002 … … 1719 1719 # Define the identity of the package. 1720 1720 PACKAGE='orxonox' 1721 VERSION=' 2.0.1-pre-alpha'1721 VERSION='0.2.1-pre-alpha' 1722 1722 1723 1723 … … 7946 7946 cat >&5 <<_CSEOF 7947 7947 7948 This file was extended by orxonox $as_me 2.0.1-pre-alpha, which was7948 This file was extended by orxonox $as_me 0.2.1-pre-alpha, which was 7949 7949 generated by GNU Autoconf 2.59. Invocation command line was 7950 7950 … … 8009 8009 cat >>$CONFIG_STATUS <<_ACEOF 8010 8010 ac_cs_version="\\ 8011 orxonox config.status 2.0.1-pre-alpha8011 orxonox config.status 0.2.1-pre-alpha 8012 8012 configured by $0, generated by GNU Autoconf 2.59, 8013 8013 with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" -
orxonox/branches/parenting/src/Makefile.am
r3311 r3319 32 32 base_object.cc \ 33 33 helper_parent.cc \ 34 track_manager.cc 34 track_manager.cc \ 35 curve.cc 35 36 36 37 noinst_HEADERS = ability.h \ … … 70 71 base_object.h \ 71 72 helper_parent.h \ 72 track_manager.h 73 track_manager.h \ 74 curve.h 73 75 74 76 -
orxonox/branches/parenting/src/Makefile.in
r3311 r3319 62 62 material.$(OBJEXT) list.$(OBJEXT) p_node.$(OBJEXT) \ 63 63 null_parent.$(OBJEXT) base_object.$(OBJEXT) \ 64 helper_parent.$(OBJEXT) track_manager.$(OBJEXT) 64 helper_parent.$(OBJEXT) track_manager.$(OBJEXT) \ 65 curve.$(OBJEXT) 65 66 orxonox_OBJECTS = $(am_orxonox_OBJECTS) 66 67 orxonox_LDADD = $(LDADD) … … 72 73 @AMDEP_TRUE@ ./$(DEPDIR)/base_object.Po ./$(DEPDIR)/camera.Po \ 73 74 @AMDEP_TRUE@ ./$(DEPDIR)/campaign.Po ./$(DEPDIR)/collision.Po \ 74 @AMDEP_TRUE@ ./$(DEPDIR)/command_node.Po \75 @AMDEP_TRUE@ ./$(DEPDIR)/command_node.Po ./$(DEPDIR)/curve.Po \ 75 76 @AMDEP_TRUE@ ./$(DEPDIR)/data_tank.Po \ 76 77 @AMDEP_TRUE@ ./$(DEPDIR)/environment.Po \ … … 227 228 base_object.cc \ 228 229 helper_parent.cc \ 229 track_manager.cc 230 track_manager.cc \ 231 curve.cc 230 232 231 233 noinst_HEADERS = ability.h \ … … 265 267 base_object.h \ 266 268 helper_parent.h \ 267 track_manager.h 269 track_manager.h \ 270 curve.h 268 271 269 272 EXTRA_DIST = orxonox.conf … … 350 353 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/collision.Po@am__quote@ 351 354 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/command_node.Po@am__quote@ 355 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/curve.Po@am__quote@ 352 356 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/data_tank.Po@am__quote@ 353 357 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/environment.Po@am__quote@ -
orxonox/branches/parenting/src/curve.cc
r3311 r3319 156 156 \return a Vector to the calculated position 157 157 */ 158 Vector BezierCurve::getPos( ) const158 Vector BezierCurve::getPos(void) const 159 159 { 160 160 return curvePoint; -
orxonox/branches/parenting/src/curve.h
r3311 r3319 55 55 56 56 57 Vector getPos () const;57 Vector getPos(void) const; 58 58 }; 59 59 -
orxonox/branches/parenting/src/stdincl.h
r3302 r3319 31 31 32 32 #include "vector.h" 33 #include "curve.h" 33 34 #include "coordinates.h" 34 35 #include "list.h" -
orxonox/branches/parenting/src/vector.cc
r3234 r3319 844 844 } 845 845 846 847 /**848 \brief Creates a new BezierCurve849 */850 BezierCurve::BezierCurve (void)851 {852 nodeCount = 0;853 firstNode = new PathNode;854 currentNode = firstNode;855 856 firstNode->position = Vector (.0, .0, .0);857 firstNode->number = 0;858 firstNode->next = 0; // not sure if this really points to NULL!!859 860 return;861 }862 863 /**864 \brief Deletes a BezierCurve.865 It does this by freeing all the space taken over from the nodes866 */867 BezierCurve::~BezierCurve (void)868 {869 PathNode* tmpNode;870 currentNode = firstNode;871 while (tmpNode != 0)872 {873 tmpNode = currentNode;874 currentNode = currentNode->next;875 delete tmpNode;876 }877 }878 879 /**880 \brief adds a new Node to the bezier Curve881 \param newNode a Vector to the position of the new node882 */883 void BezierCurve::addNode(const Vector& newNode)884 {885 PathNode* tmpNode;886 if (nodeCount == 0 )887 tmpNode = firstNode;888 else889 {890 tmpNode = new PathNode;891 currentNode = currentNode->next = tmpNode;892 }893 tmpNode->position = newNode;894 tmpNode->next = 0; // not sure if this really points to NULL!!895 tmpNode->number = (++nodeCount);896 return;897 }898 899 /**900 \brief calculates the Position on the curve901 \param t The position on the Curve (0<=t<=1)902 \return the Position on the Path903 */904 Vector BezierCurve::calcPos(float t)905 {906 if (nodeCount <=4)907 {908 // if (verbose >= 1)909 // printf ("Please define at least 4 nodes, until now you have only defined %i.\n", nodeCount);910 curvePoint = Vector(0,0,0);911 }912 PathNode* tmpNode = firstNode;913 914 int k,kn,nn,nkn;915 double blend,muk,munk;916 Vector b = Vector(0.0,0.0,0.0);917 918 muk = 1;919 munk = pow(1-t,(double)nodeCount);920 921 for (k=0; k<=nodeCount; k++) {922 nn = nodeCount;923 kn = k;924 nkn = nodeCount - k;925 blend = muk * munk;926 muk *= t;927 munk /= (1-t);928 while (nn >= 1) {929 blend *= nn;930 nn--;931 if (kn > 1) {932 blend /= (double)kn;933 kn--;934 }935 if (nkn > 1) {936 blend /= (double)nkn;937 nkn--;938 }939 }940 b.x += tmpNode->position.x * blend;941 b.y += tmpNode->position.y * blend;942 b.z += tmpNode->position.z * blend;943 944 tmpNode = tmpNode->next;945 }946 return b;947 }948 949 Vector BezierCurve::calcDirection (float t)950 {951 double diff = .00000000001;952 953 Vector diffV = ((calcPos(t+diff) - calcPos(t))/diff);954 diffV.normalize();955 return diffV;956 }957 958 /**959 \brief returns the Position of the point calculated on the Curve960 \return a Vector to the calculated position961 */962 Vector BezierCurve::getPos() const963 {964 return curvePoint;965 } -
orxonox/branches/parenting/src/vector.h
r3228 r3319 149 149 }; 150 150 151 152 153 //! Bezier Curve154 /**155 Class to handle bezier curves in 3-dimesnsional space156 157 needed for the Tracking system in OrxOnoX.158 */159 class BezierCurve160 {161 private:162 int nodeCount;163 Vector curvePoint;164 165 struct PathNode166 {167 int number;168 Vector position;169 PathNode* next;170 };171 172 PathNode* firstNode;173 PathNode* currentNode;174 175 public:176 BezierCurve (void);177 ~BezierCurve (void);178 void addNode (const Vector& newNode);179 Vector calcPos (float t);180 Vector calcDirection (float t);181 182 Vector getPos () const;183 };184 185 186 187 151 #endif /* _VECTOR_H */ -
orxonox/branches/parenting/src/world.cc
r3311 r3319 153 153 case DEBUG_WORLD_0: 154 154 { 155 testCurve = new BezierCurve(); 156 testCurve->addNode(Vector(0,0,0)); 157 testCurve->addNode(Vector(5,7,0)); 158 testCurve->addNode(Vector(10,-5,0)); 159 testCurve->addNode(Vector(20, 0,10)); 160 testCurve->addNode(Vector(50, 7,-5)); 161 155 162 this->nullParent = NullParent::getInstance (); 156 163 this->nullParent->setName ("NullParent"); … … 438 445 glEnd(); 439 446 447 glBegin(GL_LINES); 448 for(float i=0.0; i<1; i+=.01) 449 { 450 glVertex3f(testCurve->calcPos(i).x, testCurve->calcPos(i).y, testCurve->calcPos(i).z); 451 } 452 glEnd(); 440 453 glEndList(); 441 454 } -
orxonox/branches/parenting/src/world.h
r3311 r3319 66 66 Camera* localCamera; 67 67 68 69 BezierCurve* testCurve; 68 70 private: 69 71 Uint32 lastFrame; //!> last time of frame
Note: See TracChangeset
for help on using the changeset viewer.