Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1920 in orxonox.OLD for orxonox/trunk/core


Ignore:
Timestamp:
Jun 8, 2004, 1:47:33 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: rockets added (in 3D)

Location:
orxonox/trunk/core
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/core/Makefile

    r1904 r1920  
    2929        orxonox.h \
    3030        data_core.h
    31        
     31
    3232SOURCES = \
    3333        orxonox.cc \
     
    4343        environment.o \
    4444        shoot_laser.o \
     45        shoot_rocket.o \
    4546        ai.o
    4647
     
    7576        @echo ""
    7677        @echo "For further info see the README file"
    77        
     78
    7879clean:
    7980        rm -rf *.o *~ orxonox
     
    8788#data_tank.o: data_tank.cc \
    8889#               data_tank.h     
    89        
     90
    9091#EOF
  • orxonox/trunk/core/player.cc

    r1900 r1920  
    1919#include "player.h"
    2020#include <iostream>
     21#include <stdlib.h>
    2122
    2223
     
    2829  xCor = yCor = zCor = 0;
    2930  shootLaser = new ShootLaser;
     31  shootRocket = new ShootRocket;
    3032}
    3133
     
    7678  shootLaser->addShootExt(xCor, yCor, zCor, .1, .4, .0);
    7779  shootLaser->addShootExt(xCor, yCor, zCor, -0.1, .4, .0);
     80  shootRocket->addShoot(xCor, yCor, zCor);
    7881  //cout << "Player::shoot" << endl;
    7982}
     
    9295  /* draw all the shoots additionaly */
    9396  shootLaser->drawShoot();
     97  shootRocket->drawShoot();
    9498  //cout << "Player::drawPlayer" << endl;
    9599}
  • orxonox/trunk/core/player.h

    r1904 r1920  
    77
    88#include "shoot_laser.h"
     9#include "shoot_rocket.h"
    910#include "data_tank.h"
    1011
     
    2425  /* this player wanna shoot? so include a ref to ShootLaser */
    2526  ShootLaser* shootLaser;
     27  ShootRocket* shootRocket;
    2628
    2729  void setPosition(float x, float y, float z);
  • orxonox/trunk/core/shoot_laser.cc

    r1919 r1920  
    4747      glPushMatrix();
    4848      glTranslatef(tmpShoot->xCor, tmpShoot->yCor, tmpShoot->zCor);
    49       tmpShoot->xCor+=tmpShoot->xInc;
    50       tmpShoot->yCor+=tmpShoot->yInc;
     49      tmpShoot->xCor+=tmpShoot->xVel;
     50      tmpShoot->yCor+=tmpShoot->yVel;
    5151      glScalef(0.1, 0.1, 0.1);
    5252      glutWireCube(1.0);
     
    113113  shoot* sh = new shoot;
    114114  sh->xCor = x; sh->yCor = y; sh->zCor = z;
    115   sh->xInc = 0; sh->yInc = .4/step; sh->zInc = 0;
     115  sh->xVel = 0; sh->yVel = .4/step; sh->zVel = 0;
    116116  sh->next = lastShoot;
    117117  lastShoot = sh;
     
    119119
    120120void ShootLaser::addShootExt(float x, float y, float z,
    121                              float xInc, float yInc, float zInc)
     121                             float xVel, float yVel, float zVel)
    122122{
    123123  //cout << "ShootLaser::addShootExtended" << endl;
    124124  shoot* sh = new shoot;
    125125  sh->xCor = x; sh->yCor = y; sh->zCor = z;
    126   sh->xInc = xInc/step; sh->yInc = yInc/step; sh->zInc = zInc/step;
     126  sh->xVel = xVel/step; sh->yVel = yVel/step; sh->zVel = zVel/step;
    127127  sh->next = lastShoot;
    128128  lastShoot = sh;
  • orxonox/trunk/core/shoot_laser.h

    r1904 r1920  
    2020    float yCor;
    2121    float zCor;   
    22     float xInc;
    23     float yInc;
    24     float zInc;
     22    float xVel;
     23    float yVel;
     24    float zVel;
    2525    float collisionRadius;
    2626  };
     
    3333  void addShoot(shoot* sh);
    3434  void addShoot(float x, float y, float z);
    35   void addShootExt(float x, float y, float z, float xInc, float yInc, float zInc);
     35  void addShootExt(float x, float y, float z, float xVel, float yVel, float zVel);
    3636  void setShootStep(float step);
    3737  void removeShoot(shoot* sh);
  • orxonox/trunk/core/world.h

    r1917 r1920  
    1212#include "environment.h"
    1313#include "shoot_laser.h"
     14#include "shoot_rocket.h"
    1415#include "stdincl.h"
    1516#include "data_tank.h"
Note: See TracChangeset for help on using the changeset viewer.