fixed bugs in the Photo Renderer
This commit is contained in:
parent
efd1656fc8
commit
0979cff505
@ -2034,6 +2034,7 @@ PhotoFrame.fileFilter.png = PNG Image
|
|||||||
PhotoFrame.menu.edit.copy = Copy Image
|
PhotoFrame.menu.edit.copy = Copy Image
|
||||||
PhotoFrame.menu.edit.copy.desc = Copy image to clipboard
|
PhotoFrame.menu.edit.copy.desc = Copy image to clipboard
|
||||||
PhotoFrame.menu.edit.settings = Photo Settings
|
PhotoFrame.menu.edit.settings = Photo Settings
|
||||||
|
PhotoFrame.menu.edit.unk = Unknown Setting
|
||||||
PhotoFrame.menu.window = Window
|
PhotoFrame.menu.window = Window
|
||||||
PhotoFrame.menu.window.size = Size
|
PhotoFrame.menu.window.size = Size
|
||||||
PhotoFrame.menu.window.size.portrait = {0} Portrait
|
PhotoFrame.menu.window.size.portrait = {0} Portrait
|
||||||
|
@ -206,7 +206,7 @@ public class PhotoFrame extends JFrame {
|
|||||||
menu = new JMenu(trans.get("main.menu.edit"));
|
menu = new JMenu(trans.get("main.menu.edit"));
|
||||||
menu.setMnemonic(KeyEvent.VK_E);
|
menu.setMnemonic(KeyEvent.VK_E);
|
||||||
// // Rocket editing
|
// // Rocket editing
|
||||||
menu.getAccessibleContext().setAccessibleDescription(trans.get("BasicFrame.menu.Rocketedt"));
|
menu.getAccessibleContext().setAccessibleDescription(trans.get("PhotoFrame.menu.edit.unk"));
|
||||||
menubar.add(menu);
|
menubar.add(menu);
|
||||||
|
|
||||||
Action action = new AbstractAction(trans.get("PhotoFrame.menu.edit.copy")) {
|
Action action = new AbstractAction(trans.get("PhotoFrame.menu.edit.copy")) {
|
||||||
|
@ -45,6 +45,7 @@ import net.sf.openrocket.gui.figure3d.TextureCache;
|
|||||||
import net.sf.openrocket.gui.figure3d.photo.exhaust.FlameRenderer;
|
import net.sf.openrocket.gui.figure3d.photo.exhaust.FlameRenderer;
|
||||||
import net.sf.openrocket.gui.main.Splash;
|
import net.sf.openrocket.gui.main.Splash;
|
||||||
import net.sf.openrocket.motor.Motor;
|
import net.sf.openrocket.motor.Motor;
|
||||||
|
import net.sf.openrocket.motor.MotorConfiguration;
|
||||||
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
|
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
|
||||||
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
import net.sf.openrocket.rocketcomponent.FlightConfigurationId;
|
||||||
import net.sf.openrocket.rocketcomponent.MotorMount;
|
import net.sf.openrocket.rocketcomponent.MotorMount;
|
||||||
@ -95,16 +96,6 @@ public class PhotoPanel extends JPanel implements GLEventListener {
|
|||||||
rr = new RealisticRenderer(doc);
|
rr = new RealisticRenderer(doc);
|
||||||
rr.init(drawable);
|
rr.init(drawable);
|
||||||
|
|
||||||
doc.getDefaultConfiguration().addChangeListener(
|
|
||||||
new StateChangeListener() {
|
|
||||||
@Override
|
|
||||||
public void stateChanged(EventObject e) {
|
|
||||||
log.debug("Repainting on config state change");
|
|
||||||
needUpdate = true;
|
|
||||||
PhotoPanel.this.repaint();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
doc.addDocumentChangeListener(new DocumentChangeListener() {
|
doc.addDocumentChangeListener(new DocumentChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void documentChanged(DocumentChangeEvent event) {
|
public void documentChanged(DocumentChangeEvent event) {
|
||||||
@ -422,33 +413,31 @@ public class PhotoPanel extends JPanel implements GLEventListener {
|
|||||||
final FlightConfigurationId motorID = configuration.getFlightConfigurationID();
|
final FlightConfigurationId motorID = configuration.getFlightConfigurationID();
|
||||||
|
|
||||||
|
|
||||||
final Iterator<RocketComponent> iter = configuration.getActiveComponents().iterator();
|
|
||||||
|
final Iterator<MotorConfiguration> iter = configuration.getActiveMotors().iterator();
|
||||||
while( iter.hasNext()){
|
while( iter.hasNext()){
|
||||||
RocketComponent comp = iter.next();
|
MotorConfiguration curConfig = iter.next();
|
||||||
if( comp instanceof MotorMount){
|
final MotorMount mount = curConfig.getMount();
|
||||||
|
int curStageNumber = ((RocketComponent)mount).getStageNumber();
|
||||||
final MotorMount mount = (MotorMount) comp;
|
|
||||||
int curStageNumber = comp.getStageNumber();
|
|
||||||
|
|
||||||
//If this mount is not in currentStage continue on to the next one.
|
//If this mount is not in currentStage continue on to the next one.
|
||||||
if( curStageNumber != bottomStageNumber ){
|
if( curStageNumber != bottomStageNumber ){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
final Motor motor = mount.getMotorInstance(motorID).getMotor();
|
final Motor motor = mount.getMotorInstance(motorID).getMotor();
|
||||||
final double length = motor.getLength();
|
final double length = motor.getLength();
|
||||||
|
|
||||||
Coordinate[] position = ((RocketComponent) mount)
|
Coordinate[] position = ((RocketComponent) mount)
|
||||||
.toAbsolute(new Coordinate(((RocketComponent) mount)
|
.toAbsolute(new Coordinate(((RocketComponent) mount)
|
||||||
.getLength() + mount.getMotorOverhang() - length));
|
.getLength() + mount.getMotorOverhang() - length));
|
||||||
|
|
||||||
for (int i = 0; i < position.length; i++) {
|
for (int i = 0; i < position.length; i++) {
|
||||||
gl.glPushMatrix();
|
gl.glPushMatrix();
|
||||||
gl.glTranslated(position[i].x + motor.getLength(),
|
gl.glTranslated(position[i].x + motor.getLength(),
|
||||||
position[i].y, position[i].z);
|
position[i].y, position[i].z);
|
||||||
FlameRenderer.drawExhaust(gl, p, motor);
|
FlameRenderer.drawExhaust(gl, p, motor);
|
||||||
gl.glPopMatrix();
|
gl.glPopMatrix();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user