Changeset 10156 in orxonox.OLD for branches/playability/src/world_entities
- Timestamp:
- Jan 1, 2007, 9:51:49 PM (18 years ago)
- Location:
- branches/playability/src/world_entities
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/effects/wobblegrid.cc
r10154 r10156 89 89 90 90 this->grid = new Grid( this->size, this->size, this->subdivision, this->subdivision); 91 for (int i = 0; i < 25; i++)92 PRINTF(0)("Coordinate %i: %f,%f\n",i,this->grid->vertex(i).x,this->grid->vertex(i).z);93 91 this->angularSpeed = M_PI; //180; 92 this->setModel(this->grid); 94 93 } 95 94 … … 145 144 } 146 145 //this->grid->finalize(); 146 147 Vector view = this->getAbsCoor() - State::getCameraNode()->getAbsCoor(); 148 view.normalize(); 149 150 Vector up = Vector(0, 1, 0); 151 Vector h = up.cross(view); 152 up = h.cross(view); 153 154 Quaternion dir = Quaternion::lookAt( this->getAbsCoor(), this->getAbsCoor() + up, view); 155 this->setAbsDir(dir); 156 147 157 } 148 158 … … 153 163 void Wobblegrid::draw() const 154 164 { 165 166 // this->material->select(); 167 // WorldEntity::draw(); 168 // return; 169 170 155 171 if( !this->isVisible()) 156 172 return; … … 160 176 glDisable(GL_FOG); 161 177 178 glMatrixMode(GL_MODELVIEW); 162 179 glPushMatrix(); 163 180 … … 166 183 this->material->select(); 167 184 168 const PNode* camera = State::getCameraNode(); //!< @todo MUST be different169 Vector cameraPos = camera->getAbsCoor();170 Vector cameraTargetPos = State::getCameraTargetNode()->getAbsCoor();171 Vector view = cameraTargetPos - cameraPos;172 173 174 Vector up = Vector(0, 1, 0);175 up = camera->getAbsDir().apply(up);176 Vector h = up.cross(view);177 Vector v = h.cross(view);178 h.normalize();179 v.normalize();180 181 float rangle = acosf(v.dot(view)/view.len());182 183 v *= size;184 h *= size;185 186 //v += this->getAbsCoor();187 //PRINTF(0)("sizeX: %f sizeZ: %f\n", sizeX, sizeZ);188 /*int xone = 0;189 int zone = 0;190 185 191 glBegin(GL_QUADS);192 193 for( int z=0; z<4; z++)194 {195 for( int x=0; x<4; x++)196 {197 xone = x + 1;198 zone = z + 1;199 glTexCoord2f(x*.25f,z*.25f);200 glVertex3f( this->getAbsCoor().x + this->grid[z][x].x*this->sizeX2 - h.x - v.x,201 this->getAbsCoor().y - h.y - v.y,202 this->getAbsCoor().z + this->grid[z][x].z*this->sizeZ2 - h.z - v.z);203 204 glTexCoord2f(x*.25f,zone*.25f);205 glVertex3f( this->getAbsCoor().x + this->grid[zone][x].x*this->sizeX2 - h.x - v.x,206 this->getAbsCoor().y - h.y - v.y,207 this->getAbsCoor().z + this->grid[zone][x].z*this->sizeZ2 - h.z - v.z);208 209 glTexCoord2f(xone*.25f,zone*.25f);210 glVertex3f( this->getAbsCoor().x + this->grid[zone][xone].x*this->sizeX2 - h.x - v.x,211 this->getAbsCoor().y - h.y - v.y,212 this->getAbsCoor().z + this->grid[zone][xone].z*this->sizeZ2 - h.z - v.z);213 214 glTexCoord2f(xone*.25f,z*.25f);215 glVertex3f( this->getAbsCoor().x + this->grid[z][xone].x*this->sizeX2 - h.x - v.x,216 this->getAbsCoor().y - h.y - v.y,217 this->getAbsCoor().z + this->grid[z][xone].z*this->sizeZ2 - h.z - v.z);218 }219 }220 glEnd();*/221 186 glTranslatef (this->getAbsCoor ().x, 222 187 this->getAbsCoor ().y, 223 188 this->getAbsCoor ().z); 224 //Vector tmpRot = this->getAbsDir().getSpacialAxis(); 225 glRotatef (rangle, view.x, view.y, view.z ); 189 190 Vector tmpRot = this->getAbsDir().getSpacialAxis(); 191 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 192 193 //Quaternion dir = Quaternion(this->getAbsDir().getSpacialAxisAngle(),view); 194 //this->setAbsDir(dir); 226 195 //glRotatef(this->angle, 0.0, 0.0, 1.0); 227 228 196 this->grid->draw(); 229 197 -
branches/playability/src/world_entities/space_ships/space_ship.cc
r10155 r10156 358 358 359 359 360 this->trail = new Trail( 30, 100, .2, this);360 this->trail = new Trail( 10, 10, .2, this); 361 361 //this->trail->setParent( this); 362 362 this->trail->setTexture( "maps/engine.png"); 363 363 364 this->trailL = new Trail( 30, 100, .2, this);364 this->trailL = new Trail( 10, 10, .2, this); 365 365 //this->trailL->setParent( this); 366 366 this->trailL->setTexture( "maps/engine.png"); 367 367 368 this->trailR = new Trail( 30, 100, .2, this);368 this->trailR = new Trail( 10, 10, .2, this); 369 369 //this->trailR->setParent( this); 370 370 this->trailR->setTexture( "maps/engine.png"); … … 374 374 375 375 //FIXME Just testaddition to show the wobblegrid 376 Wobblegrid*test = new Wobblegrid(5);376 this->test = new Wobblegrid(5); 377 377 test->setTexture("maps/fichte_ast6.tga"); 378 378 … … 491 491 { 492 492 // Playable::tick(time);$ 493 493 this->test->tick(time); 494 494 // Own Tick Setup, as a different fire routine is used on the weapon manager 495 495 this->weaponMan.tick(time); -
branches/playability/src/world_entities/space_ships/space_ship.h
r10120 r10156 20 20 class ParticleSystem; 21 21 class Trail; 22 class Wobblegrid; 22 23 23 24 class SpaceShip : public Playable … … 199 200 Trail* trailR; //!< Burst trail 200 201 202 Wobblegrid* test; 203 201 204 }; 202 205
Note: See TracChangeset
for help on using the changeset viewer.