|
@@ -203,24 +203,26 @@ void SpielObjekt::calcDeadPlayerObject( Laser * zSchuss )
|
|
|
Punkt pb;
|
|
|
if( calcHitPoint( zSchuss->getPosition() - zSchuss->getSpeed(), zSchuss->getSpeed(), hp ) )
|
|
|
{
|
|
|
- zModel()->split( getObjectPos( hp ), getObjectDir( zSchuss->getSpeed() ) * 0.1f, "ship", a, b, pa, pb, []()
|
|
|
+ if( zModel()->split( getObjectPos( hp ), getObjectDir( zSchuss->getSpeed() ) * 0.1f, "ship", a, b, pa, pb, []()
|
|
|
{
|
|
|
return rand() / (double)RAND_MAX;
|
|
|
- } );
|
|
|
- hp = ( hp * getSize() ).rotation( getDrehung() ) + getPosition();
|
|
|
- pa = pa.rotation( getDrehung() ) + getPosition();
|
|
|
- pb = pb.rotation( getDrehung() ) + getPosition();
|
|
|
- Array< Polygon2D > *npaA = new Array< Polygon2D >();
|
|
|
- npaA->add( a );
|
|
|
- Model2DData *npdA = new Model2DData();
|
|
|
- npdA->erstelleModell( npaA );
|
|
|
- Array< Polygon2D > *npaB = new Array< Polygon2D >();
|
|
|
- npaB->add( b );
|
|
|
- Model2DData *npdB = new Model2DData();
|
|
|
- npdB->erstelleModell( npaB );
|
|
|
- if( deadPlayer )
|
|
|
- deadPlayer->release();
|
|
|
- deadPlayer = new DeadPlayer( npdA, npdB, pa, pb, getSpeed() * ( rand() / (float)RAND_MAX ), getSpeed() * ( rand() / (float)RAND_MAX ), getDrehung(), getDrehung(), getDrehungSpeed() * ( rand() / (float)RAND_MAX ), getDrehungSpeed() * ( rand() / (float)RAND_MAX ), zTextur( "ship" ) );
|
|
|
+ } ) )
|
|
|
+ {
|
|
|
+ hp = ( hp * getSize() ).rotation( getDrehung() ) + getPosition();
|
|
|
+ pa = pa.rotation( getDrehung() ) + getPosition();
|
|
|
+ pb = pb.rotation( getDrehung() ) + getPosition();
|
|
|
+ Array< Polygon2D > *npaA = new Array< Polygon2D >();
|
|
|
+ npaA->add( a );
|
|
|
+ Model2DData *npdA = new Model2DData();
|
|
|
+ npdA->erstelleModell( npaA );
|
|
|
+ Array< Polygon2D > *npaB = new Array< Polygon2D >();
|
|
|
+ npaB->add( b );
|
|
|
+ Model2DData *npdB = new Model2DData();
|
|
|
+ npdB->erstelleModell( npaB );
|
|
|
+ if( deadPlayer )
|
|
|
+ deadPlayer->release();
|
|
|
+ deadPlayer = new DeadPlayer( npdA, npdB, pa, pb, getSpeed() * ( rand() / (float)RAND_MAX ), getSpeed() * ( rand() / (float)RAND_MAX ), getDrehung(), getDrehung(), getDrehungSpeed() * ( rand() / (float)RAND_MAX ), getDrehungSpeed() * ( rand() / (float)RAND_MAX ), zTextur( "ship" ) );
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|