|
@@ -13,52 +13,52 @@
|
|
Ship::Ship( Model2DData *data, Vec2< float > p, Vec2< float > s, float r )
|
|
Ship::Ship( Model2DData *data, Vec2< float > p, Vec2< float > s, float r )
|
|
: Model2DObject()
|
|
: Model2DObject()
|
|
{
|
|
{
|
|
- for( auto i = data->polygons->getArray(); i.set; i++ )
|
|
|
|
|
|
+ for( auto i = data->polygons->getIterator(); i; i++ )
|
|
{
|
|
{
|
|
- if( i.var.name->istGleich( "engine_l" ) )
|
|
|
|
|
|
+ if( i._.name->istGleich( "engine_l" ) )
|
|
{
|
|
{
|
|
- stL = *i.var.schwerpunkt;
|
|
|
|
|
|
+ stL = *i._.schwerpunkt;
|
|
Vertex l, r;
|
|
Vertex l, r;
|
|
for( int j = 0; j < 4; j++ )
|
|
for( int j = 0; j < 4; j++ )
|
|
{
|
|
{
|
|
- if( i.var.tKordinaten->get( j ).y == 1.f )
|
|
|
|
|
|
+ if( i._.tKordinaten->get( j ).y == 1.f )
|
|
{
|
|
{
|
|
- if( i.var.tKordinaten->get( j ).x == 0.f )
|
|
|
|
- l = i.var.vertex->get( j );
|
|
|
|
- if( i.var.tKordinaten->get( j ).x == 1.f )
|
|
|
|
- r = i.var.vertex->get( j );
|
|
|
|
|
|
+ if( i._.tKordinaten->get( j ).x == 0.f )
|
|
|
|
+ l = i._.vertex->get( j );
|
|
|
|
+ if( i._.tKordinaten->get( j ).x == 1.f )
|
|
|
|
+ r = i._.vertex->get( j );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
kL = ( ( l + ( r - l ) * 0.5 ) - stL );
|
|
kL = ( ( l + ( r - l ) * 0.5 ) - stL );
|
|
}
|
|
}
|
|
- if( i.var.name->istGleich( "engine_r" ) )
|
|
|
|
|
|
+ if( i._.name->istGleich( "engine_r" ) )
|
|
{
|
|
{
|
|
- stR = *i.var.schwerpunkt;
|
|
|
|
|
|
+ stR = *i._.schwerpunkt;
|
|
Vertex l, r;
|
|
Vertex l, r;
|
|
for( int j = 0; j < 4; j++ )
|
|
for( int j = 0; j < 4; j++ )
|
|
{
|
|
{
|
|
- if( i.var.tKordinaten->get( j ).y == 1.f )
|
|
|
|
|
|
+ if( i._.tKordinaten->get( j ).y == 1.f )
|
|
{
|
|
{
|
|
- if( i.var.tKordinaten->get( j ).x == 0.f )
|
|
|
|
- l = i.var.vertex->get( j );
|
|
|
|
- if( i.var.tKordinaten->get( j ).x == 1.f )
|
|
|
|
- r = i.var.vertex->get( j );
|
|
|
|
|
|
+ if( i._.tKordinaten->get( j ).x == 0.f )
|
|
|
|
+ l = i._.vertex->get( j );
|
|
|
|
+ if( i._.tKordinaten->get( j ).x == 1.f )
|
|
|
|
+ r = i._.vertex->get( j );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
kR = ( ( l + ( r - l ) * 0.5 ) - stR );
|
|
kR = ( ( l + ( r - l ) * 0.5 ) - stR );
|
|
}
|
|
}
|
|
- if( i.var.name->istGleich( "engine_m" ) )
|
|
|
|
|
|
+ if( i._.name->istGleich( "engine_m" ) )
|
|
{
|
|
{
|
|
- stM = *i.var.schwerpunkt;
|
|
|
|
|
|
+ stM = *i._.schwerpunkt;
|
|
Vertex l, r;
|
|
Vertex l, r;
|
|
for( int j = 0; j < 4; j++ )
|
|
for( int j = 0; j < 4; j++ )
|
|
{
|
|
{
|
|
- if( i.var.tKordinaten->get( j ).y == 1.f )
|
|
|
|
|
|
+ if( i._.tKordinaten->get( j ).y == 1.f )
|
|
{
|
|
{
|
|
- if( i.var.tKordinaten->get( j ).x == 0.f )
|
|
|
|
- l = i.var.vertex->get( j );
|
|
|
|
- if( i.var.tKordinaten->get( j ).x == 1.f )
|
|
|
|
- r = i.var.vertex->get( j );
|
|
|
|
|
|
+ if( i._.tKordinaten->get( j ).x == 0.f )
|
|
|
|
+ l = i._.vertex->get( j );
|
|
|
|
+ if( i._.tKordinaten->get( j ).x == 1.f )
|
|
|
|
+ r = i._.vertex->get( j );
|
|
}
|
|
}
|
|
}
|
|
}
|
|
kM = ( ( l + ( r - l ) * 0.5 ) - stM );
|
|
kM = ( ( l + ( r - l ) * 0.5 ) - stM );
|