Draw flames only for bottom most stage.
This commit is contained in:
parent
1d38fb93db
commit
9f13119317
@ -44,6 +44,7 @@ import net.sf.openrocket.motor.Motor;
|
|||||||
import net.sf.openrocket.rocketcomponent.Configuration;
|
import net.sf.openrocket.rocketcomponent.Configuration;
|
||||||
import net.sf.openrocket.rocketcomponent.MotorMount;
|
import net.sf.openrocket.rocketcomponent.MotorMount;
|
||||||
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
import net.sf.openrocket.rocketcomponent.RocketComponent;
|
||||||
|
import net.sf.openrocket.rocketcomponent.Stage;
|
||||||
import net.sf.openrocket.startup.Application;
|
import net.sf.openrocket.startup.Application;
|
||||||
import net.sf.openrocket.startup.Preferences;
|
import net.sf.openrocket.startup.Preferences;
|
||||||
import net.sf.openrocket.util.Color;
|
import net.sf.openrocket.util.Color;
|
||||||
@ -413,14 +414,28 @@ public class PhotoPanel extends JPanel implements GLEventListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rr.render(drawable, configuration, new HashSet<RocketComponent>());
|
rr.render(drawable, configuration, new HashSet<RocketComponent>());
|
||||||
// glu.gluSphere(new GLUquadricImpl(gl, false), .2, 10, 10);
|
|
||||||
|
|
||||||
String motorID = configuration.getFlightConfigurationID();
|
//Figure out the lowest stage shown
|
||||||
Iterator<MotorMount> iterator = configuration.motorIterator();
|
final int currentStageNumber = configuration.getActiveStages()[configuration.getActiveStages().length-1];
|
||||||
while (iterator.hasNext()) {
|
final Stage currentStage = (Stage)configuration.getRocket().getChild(currentStageNumber);
|
||||||
MotorMount mount = iterator.next();
|
|
||||||
Motor motor = mount.getMotorConfiguration().get(motorID).getMotor();
|
final String motorID = configuration.getFlightConfigurationID();
|
||||||
double length = motor.getLength();
|
final Iterator<MotorMount> iterator = configuration.motorIterator();
|
||||||
|
motor: while (iterator.hasNext()) {
|
||||||
|
final MotorMount mount = iterator.next();
|
||||||
|
|
||||||
|
//If this mount is not in currentStage continue on to the next one.
|
||||||
|
RocketComponent parent = ((RocketComponent)mount);
|
||||||
|
while ( null != (parent = parent.getParent()) ){
|
||||||
|
if ( parent instanceof Stage ){
|
||||||
|
if ( parent != currentStage )
|
||||||
|
continue motor;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
final Motor motor = mount.getMotorConfiguration().get(motorID).getMotor();
|
||||||
|
final double length = motor.getLength();
|
||||||
|
|
||||||
Coordinate[] position = ((RocketComponent) mount)
|
Coordinate[] position = ((RocketComponent) mount)
|
||||||
.toAbsolute(new Coordinate(((RocketComponent) mount)
|
.toAbsolute(new Coordinate(((RocketComponent) mount)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user