[cleanup] cleans up extra debugging from RocketRenderer, also fixed whitespace
This commit is contained in:
parent
800101e6bb
commit
7046d02bae
@ -161,77 +161,47 @@ public abstract class RocketRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Collection<Geometry> getTreeGeometry( FlightConfiguration config){
|
private Collection<Geometry> getTreeGeometry( FlightConfiguration config){
|
||||||
System.err.println(String.format("==== Building tree geometry ===="));
|
// input
|
||||||
|
final InstanceMap imap = config.getActiveInstances();
|
||||||
|
|
||||||
// input
|
// output buffer
|
||||||
final InstanceMap imap = config.getActiveInstances();
|
final Collection<Geometry> treeGeometry = new ArrayList<Geometry>();
|
||||||
|
|
||||||
// output buffer
|
for(Map.Entry<RocketComponent, ArrayList<InstanceContext>> entry: imap.entrySet() ) {
|
||||||
final Collection<Geometry> treeGeometry = new ArrayList<Geometry>();
|
|
||||||
|
|
||||||
for(Map.Entry<RocketComponent, ArrayList<InstanceContext>> entry: imap.entrySet() ) {
|
|
||||||
final RocketComponent comp = entry.getKey();
|
final RocketComponent comp = entry.getKey();
|
||||||
|
|
||||||
final ArrayList<InstanceContext> contextList = entry.getValue();
|
final ArrayList<InstanceContext> contextList = entry.getValue();
|
||||||
System.err.println(String.format("....[%s]", comp.getName()));
|
|
||||||
|
|
||||||
for(InstanceContext context: contextList ) {
|
for(InstanceContext context: contextList ) {
|
||||||
System.err.println(String.format("........[% 2d] %s", context.instanceNumber, context.getLocation().toPreciseString()));
|
Geometry instanceGeometry = cr.getComponentGeometry( comp, context.transform );
|
||||||
|
instanceGeometry.active = context.active;
|
||||||
// System.err.println( String.format("%s[ %s ]", indent, comp.getName()));
|
treeGeometry.add( instanceGeometry );
|
||||||
// System.err.println( String.format("%s :: %12.8g / %12.8g / %12.8g (m) @ %8.4g (rads) ", indent, currentLocation.x, currentLocation.y, currentLocation.z, currentAngle ));
|
|
||||||
|
|
||||||
Geometry instanceGeometry = cr.getComponentGeometry( comp, context.transform );
|
|
||||||
instanceGeometry.active = context.active;
|
|
||||||
treeGeometry.add( instanceGeometry );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return treeGeometry;
|
return treeGeometry;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void renderTree( GL2 gl, final Collection<Geometry> geometryList){
|
private void renderTree( GL2 gl, final Collection<Geometry> geometryList){
|
||||||
//cycle through opaque components first, then transparent to preserve proper depth testing
|
//cycle through opaque components first, then transparent to preserve proper depth testing
|
||||||
for(Geometry geom: geometryList ) {
|
for(Geometry geom: geometryList ) {
|
||||||
if( geom.active ) {
|
if( geom.active ) {
|
||||||
//if not transparent
|
//if not transparent
|
||||||
if( !isDrawnTransparent( (RocketComponent)geom.obj) ){
|
if( !isDrawnTransparent( (RocketComponent)geom.obj) ){
|
||||||
renderComponent(gl, geom, 1.0f);
|
renderComponent(gl, geom, 1.0f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(Geometry geom: geometryList ) {
|
for(Geometry geom: geometryList ) {
|
||||||
if( geom.active ) {
|
if( geom.active ) {
|
||||||
if( isDrawnTransparent( (RocketComponent)geom.obj) ){
|
if( isDrawnTransparent( (RocketComponent)geom.obj) ){
|
||||||
// Draw T&T front faces blended, without depth test
|
// Draw T&T front faces blended, without depth test
|
||||||
renderComponent(gl, geom, 0.2f);
|
renderComponent(gl, geom, 0.2f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void renderMotors(GL2 gl, FlightConfiguration configuration) {
|
private void renderMotors(GL2 gl, FlightConfiguration configuration) {
|
||||||
// FlightConfigurationId motorID = configuration.getFlightConfigurationID();
|
|
||||||
//
|
|
||||||
// for( RocketComponent comp : configuration.getActiveComponents()){
|
|
||||||
// if( comp instanceof MotorMount){
|
|
||||||
//
|
|
||||||
// MotorMount mount = (MotorMount) comp;
|
|
||||||
// Motor motor = mount.getMotorInstance(motorID).getMotor();
|
|
||||||
// if( null == motor )???;
|
|
||||||
// double length = motor.getLength();
|
|
||||||
//
|
|
||||||
// Coordinate[] position = ((RocketComponent) mount).toAbsolute(new Coordinate(((RocketComponent) mount)
|
|
||||||
// .getLength() + mount.getMotorOverhang() - length));
|
|
||||||
//
|
|
||||||
// for (int i = 0; i < position.length; i++) {
|
|
||||||
// gl.glPushMatrix();
|
|
||||||
// gl.glTranslated(position[i].x, position[i].y, position[i].z);
|
|
||||||
// renderMotor(gl, motor);
|
|
||||||
// gl.glPopMatrix();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
for( MotorConfiguration curMotor : configuration.getActiveMotors()){
|
for( MotorConfiguration curMotor : configuration.getActiveMotors()){
|
||||||
MotorMount mount = curMotor.getMount();
|
MotorMount mount = curMotor.getMount();
|
||||||
Motor motor = curMotor.getMotor();
|
Motor motor = curMotor.getMotor();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user