Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3311 in orxonox.OLD


Ignore:
Timestamp:
Dec 31, 2004, 2:20:21 PM (19 years ago)
Author:
patrick
Message:

oroxnox/branches/parenting: implemented helperParent and made some tests with the opengl nurbs lib

Location:
orxonox/branches/parenting/src
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/parenting/src/Makefile.am

    r3310 r3311  
    3131                 null_parent.cc \
    3232                 base_object.cc \
    33                  helper_parent.cc
     33                 helper_parent.cc \
     34                 track_manager.cc
    3435
    3536noinst_HEADERS = ability.h \
     
    6869                 null_parent.h \
    6970                 base_object.h \
    70                  helper_parent.h
     71                 helper_parent.h \
     72                 track_manager.h
    7173
    7274
  • orxonox/branches/parenting/src/Makefile.in

    r3310 r3311  
    6262        material.$(OBJEXT) list.$(OBJEXT) p_node.$(OBJEXT) \
    6363        null_parent.$(OBJEXT) base_object.$(OBJEXT) \
    64         helper_parent.$(OBJEXT)
     64        helper_parent.$(OBJEXT) track_manager.$(OBJEXT)
    6565orxonox_OBJECTS = $(am_orxonox_OBJECTS)
    6666orxonox_LDADD = $(LDADD)
     
    8282@AMDEP_TRUE@    ./$(DEPDIR)/orxonox.Po ./$(DEPDIR)/p_node.Po \
    8383@AMDEP_TRUE@    ./$(DEPDIR)/player.Po ./$(DEPDIR)/story_entity.Po \
    84 @AMDEP_TRUE@    ./$(DEPDIR)/track.Po ./$(DEPDIR)/vector.Po \
    85 @AMDEP_TRUE@    ./$(DEPDIR)/world.Po ./$(DEPDIR)/world_entity.Po
     84@AMDEP_TRUE@    ./$(DEPDIR)/track.Po ./$(DEPDIR)/track_manager.Po \
     85@AMDEP_TRUE@    ./$(DEPDIR)/vector.Po ./$(DEPDIR)/world.Po \
     86@AMDEP_TRUE@    ./$(DEPDIR)/world_entity.Po
    8687CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
    8788        $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
     
    225226                 null_parent.cc \
    226227                 base_object.cc \
    227                  helper_parent.cc
     228                 helper_parent.cc \
     229                 track_manager.cc
    228230
    229231noinst_HEADERS = ability.h \
     
    262264                 null_parent.h \
    263265                 base_object.h \
    264                  helper_parent.h
     266                 helper_parent.h \
     267                 track_manager.h
    265268
    266269EXTRA_DIST = orxonox.conf
     
    362365@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/story_entity.Po@am__quote@
    363366@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/track.Po@am__quote@
     367@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/track_manager.Po@am__quote@
    364368@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector.Po@am__quote@
    365369@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/world.Po@am__quote@
  • orxonox/branches/parenting/src/curve.cc

    r3217 r3311  
    1111   ### File Specific:
    1212   main-programmer: Benjamin Grauer
    13    co-programmer: ...
     13   co-programmer: Patrick Boenzli
     14
     15   ADD: Patrick Boenzli           B-Spline
     16
    1417
    1518   TODO:
    1619     local-Time implementation
    17      closed Bezier Curve
    1820     NURBS
    1921     
  • orxonox/branches/parenting/src/curve.h

    r3217 r3311  
     1
    12/*!
    23    \file curve.h
     
    5758};
    5859
     60
     61//! B-Spline
     62/**
     63   class to handle b-spline in 3d space
     64*/
     65class BSplieCurve : public Curve
     66{
     67
     68
     69};
     70
     71
    5972int ncr(int n, int i);
    6073
  • orxonox/branches/parenting/src/null_parent.cc

    r3306 r3311  
    2222using namespace std;
    2323
     24NullParent* NullParent::singletonRef = 0;
     25
     26NullParent* NullParent::getInstance ()
     27{
     28  if( singletonRef == NULL)
     29    singletonRef = new NullParent ();
     30  return singletonRef;
     31}
    2432
    2533/**
     
    4856   \todo this deconstructor is not jet implemented - do it
    4957*/
    50 NullParent::~NullParent () {}
     58NullParent::~NullParent ()
     59{
     60  delete singletonRef;
     61  singletonRef = NULL;
     62}
    5163
    5264
  • orxonox/branches/parenting/src/null_parent.h

    r3308 r3311  
    1515
    1616 public:
     17  static NullParent* getInstance ();
     18  ~NullParent ();
     19 
     20  static NullParent* singletonRef;
     21
     22  virtual void update (float timeStamp);
     23
     24 private:
    1725  NullParent ();
    1826  NullParent (Vector* absCoordinate);
    19   ~NullParent ();
    20 
    21   virtual void update (float timeStamp);
    2227
    2328};
  • orxonox/branches/parenting/src/world.cc

    r3309 r3311  
    2525#include "p_node.h"
    2626#include "null_parent.h"
     27#include "helper_parent.h"
    2728
    2829using namespace std;
     
    8485}
    8586
     87GLfloat ctrlpoints[4][3] = {
     88  {20.0, 10.0, 5.0}, {40.0, -10.0, 0.0},
     89  {60.0, -10.0, 5.0}, {80.0, 10.0, 5.0}};
     90
    8691
    8792ErrorMessage World::init()
     
    9297  cn->enable(true);
    9398
    94   /* this is only for test purposes */
    95   this->debug ();
    96 }
     99  glMap1f (GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, &ctrlpoints[0][0]);
     100  glEnable (GL_MAP1_VERTEX_3);
     101 
     102  //theNurb = gluNewNurbsRenderer ();
     103  //gluNurbsProperty (theNurb, GLU_NURBS_MODE, GLU_NURBS_TESSELLATOR);
     104  //gluNurbsProperty (theNurb, GLU_NURBS_VERTEX, vertexCallback );
     105}
     106
     107
    97108
    98109ErrorMessage World::start()
     
    124135
    125136}
     137
     138
     139
    126140
    127141void World::load()
     
    139153        case DEBUG_WORLD_0:
    140154          {
    141             this->nullParent = new NullParent ();
     155            this->nullParent = NullParent::getInstance ();
    142156            this->nullParent->setName ("NullParent");
    143157
     
    160174            // !\todo old track-system has to be removed
    161175
     176            //create helper for player
     177            HelperParent* hp = new HelperParent ();
     178            /* the player has to be added to this helper */
     179
    162180            // create a player
    163             WorldEntity* myPlayer = new Player();
     181            WorldEntity* myPlayer = new Player ();
    164182            myPlayer->setName ("player");
    165             this->spawn(myPlayer);
     183            this->spawn (myPlayer);
    166184            this->localPlayer = myPlayer;           
    167185
    168186            // bind input
    169             Orxonox *orx = Orxonox::getInstance();
     187            Orxonox *orx = Orxonox::getInstance ();
    170188            orx->getLocalInput()->bind (myPlayer);
    171189           
     
    188206        case DEBUG_WORLD_1:
    189207          {
    190             this->nullParent = new NullParent ();
     208            this->nullParent = NullParent::getInstance ();
     209            this->nullParent->setName ("NullParent");
    191210
    192211            // create some path nodes
     
    199218            this->pathnodes[5] = Vector(30, 50, 0);
    200219           
     220
     221
     222
    201223            // create the tracks
    202224            this->tracklen = 6;
     
    400422  //draw track
    401423  glBegin(GL_LINES);
    402   glColor3f(0,1,1);
     424  glColor3f(0.0, 1.0, 1.0);
    403425  for( int i = 0; i < tracklen; i++)
    404426    {
     
    407429    }
    408430  glEnd();
     431
     432  glBegin(GL_LINE_STRIP);
     433  glColor3f(1.0, 5.0, 1.0);
     434  for( int i = 0; i <= 30; i++)
     435    {
     436      glEvalCoord1f ((GLfloat) i/30.0);
     437    }
     438  glEnd();
     439
    409440  glEndList();
    410441}
     
    470501  // draw debug coord system
    471502  glCallList (objectList);
    472 
    473503
    474504}
     
    595625{
    596626  printf ("World::debug() - starting debug\n");
    597   PNode* p1 = new NullParent ();
     627  PNode* p1 = NullParent::getInstance ();
    598628  PNode* p2 = new PNode (new Vector(2, 2, 2), p1);
    599629  PNode* p3 = new PNode (new Vector(4, 4, 4), p1);
  • orxonox/branches/parenting/src/world.h

    r3306 r3311  
    3838  virtual void load ();
    3939  virtual void destroy ();
     40
     41  //static void vertexCallback (GLfloat* vertex);
    4042
    4143  void timeSlice (Uint32 deltaT);
Note: See TracChangeset for help on using the changeset viewer.