Add BoxBounded interface to TubeFinSet

TubeFinSets cause rocket size within the panel to be a bit off. Add
the BoxBounded interface to provide a tight BoundingBox.

Signed-off-by: Billy Olsen <billy.olsen@gmail.com>
This commit is contained in:
Billy Olsen 2020-07-25 18:18:46 -07:00
parent ec40b20ae0
commit 908e6359ff

View File

@ -12,11 +12,12 @@ import net.sf.openrocket.rocketcomponent.position.AxialMethod;
import net.sf.openrocket.rocketcomponent.position.AxialPositionable;
import net.sf.openrocket.rocketcomponent.position.RadiusMethod;
import net.sf.openrocket.startup.Application;
import net.sf.openrocket.util.BoundingBox;
import net.sf.openrocket.util.Coordinate;
import net.sf.openrocket.util.MathUtil;
import net.sf.openrocket.util.Transformation;
public class TubeFinSet extends ExternalComponent implements RingInstanceable, AxialPositionable {
public class TubeFinSet extends ExternalComponent implements AxialPositionable, BoxBounded, RingInstanceable {
private static final Translator trans = Application.getTranslator();
private final static double DEFAULT_RADIUS = 0.025;
@ -314,6 +315,14 @@ public class TubeFinSet extends ExternalComponent implements RingInstanceable, A
return bounds;
}
@Override
public BoundingBox getInstanceBoundingBox() {
BoundingBox box = new BoundingBox();
box.update(new Coordinate(0, -outerRadius, -outerRadius));
box.update(new Coordinate(length, outerRadius, outerRadius));
return box;
}
/**
* Return the radius of the BodyComponent the fin set is situated on. Currently
* only supports SymmetricComponents and returns the radius at the starting point of the