Changeset 10683 in orxonox.OLD for branches/adm
- Timestamp:
- Jun 10, 2007, 12:17:06 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/adm/src/world_entities/npcs/adm_turret.cc
r10681 r10683 78 78 } 79 79 // this->removeNodeFlags( PNODE_ALL ); 80 // this->addNodeFlags( PNODE_ROTATE_AND_MOVE ); 80 this->addNodeFlags( PNODE_ROTATE_AND_MOVE ); 81 this->addNodeFlags( PNODE_REPARENT_KEEP_POSITION ); 82 83 //HACK this is needed to get the correct coordinates instead (0, 0, 0) 84 this->updateNode( 0 ); 81 85 82 86 if ( this->isCeil ) … … 139 143 140 144 //rotate sensor 2PI/sec 141 this->sensor->setAbsDir( this->sensor->getAbsDir() * Quaternion( PI*2*dt, Vector( 0, 1, 0 ) ) );145 this->sensor->setAbsDir( this->sensor->getAbsDir() * Quaternion( PI*2*dt, Vector( 0, -1, 0 ) ) ); 142 146 143 147 … … 252 256 { 253 257 if ( this->cannons->getParent() != NullParent::getNullParent() ) 258 { 254 259 this->cannons->setParent( NullParent::getNullParent() ); 260 this->cannons->shiftCoor( this->getAbsCoor() ); 261 262 this->sensor->setParent( NullParent::getNullParent() ); 263 this->sensor->shiftCoor( this->getAbsCoor() ); 264 } 255 265 256 266 targetDir.normalize(); … … 264 274 float bestCannonAngle = 0.0f; 265 275 266 // Quaternion baseRot(0, Vector);267 //if ( isCeil )268 //{269 //printf( "ceil\n" );270 // baseRot = Quaternion( PI/2, Vector( 0, 0, 1) );271 //}276 Quaternion baseRot(0, Vector(1, 0, 0)); 277 if ( isCeil ) 278 { 279 printf( "ceil\n" ); 280 baseRot = Quaternion( PI, Vector( 1, 0, 0 ) ); 281 } 272 282 273 283 for ( int dBodyAngle = -1; dBodyAngle<2; dBodyAngle++ ) … … 290 300 Quaternion cannonRot( cannonAngle, Vector( 0, 0, 1) ); 291 301 292 //bodyRot = baseRot * bodyRot;293 //cannonRot = baseRot * cannonRot;302 bodyRot = baseRot * bodyRot; 303 cannonRot = baseRot * cannonRot; 294 304 295 305 float result = (bodyRot * cannonRot).apply( Vector( -1, 0, 0 ) ).dot( targetDir );
Note: See TracChangeset
for help on using the changeset viewer.