[fixes #741] RailButtons will correctly identify their first parent BodyTube
This commit is contained in:
parent
e90318a7ac
commit
8a14d98fcc
@ -237,8 +237,10 @@ public class RailButton extends ExternalComponent implements AnglePositionable,
|
|||||||
double parentRadius=0;
|
double parentRadius=0;
|
||||||
|
|
||||||
for (body = this.getParent(); body != null; body = body.getParent()) {
|
for (body = this.getParent(); body != null; body = body.getParent()) {
|
||||||
if (body instanceof BodyTube)
|
if (body instanceof BodyTube) {
|
||||||
parentRadius = ((BodyTube) body).getOuterRadius();
|
parentRadius = ((BodyTube) body).getOuterRadius();
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.radialDistance_m = parentRadius;
|
this.radialDistance_m = parentRadius;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user