Merge pull request #749 from teyrana/fix/741-render-rail-button

Fix/741 render rail button
This commit is contained in:
Daniel Williams 2020-08-16 14:44:58 -04:00 committed by GitHub
commit 08f49d6a04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 12 deletions

View File

@ -295,19 +295,14 @@ public class FlightConfiguration implements FlightConfigurableParameter<FlightCo
// generate the Instance's Context:
for(int currentInstanceNumber=0; currentInstanceNumber < instanceCount; currentInstanceNumber++) {
final Coordinate instanceOffset = allOffsets[currentInstanceNumber];
final Transformation offsetTransform = Transformation.getTranslationTransform( instanceOffset );
final double instanceAngle = allAngles[currentInstanceNumber];
final Transformation angleTransform = Transformation.getAxialRotation(instanceAngle);
final Transformation offsetTransform = Transformation.getTranslationTransform( allOffsets[currentInstanceNumber] );
final Transformation angleTransform = Transformation.getAxialRotation(allAngles[currentInstanceNumber]);
final Transformation currentTransform = componentTransform.applyTransformation(offsetTransform)
.applyTransformation(angleTransform);
// constructs entry in-place
.applyTransformation(angleTransform);
// constructs entry in-place
results.emplace(component, active, currentInstanceNumber, currentTransform);
for(RocketComponent child : component.getChildren()) {
getContextListAt(child, results, currentTransform);
}

View File

@ -237,8 +237,10 @@ public class RailButton extends ExternalComponent implements AnglePositionable,
double parentRadius=0;
for (body = this.getParent(); body != null; body = body.getParent()) {
if (body instanceof BodyTube)
if (body instanceof BodyTube) {
parentRadius = ((BodyTube) body).getOuterRadius();
break;
}
}
this.radialDistance_m = parentRadius;