Extract group naming

This commit is contained in:
SiboVG 2023-08-17 00:54:15 +02:00
parent 209de265ef
commit ee51a7ec49
2 changed files with 6 additions and 3 deletions

View File

@ -3,7 +3,6 @@ package net.sf.openrocket.file.wavefrontobj.export.components;
import net.sf.openrocket.file.wavefrontobj.CoordTransform;
import net.sf.openrocket.file.wavefrontobj.DefaultObj;
import net.sf.openrocket.file.wavefrontobj.ObjUtils;
import net.sf.openrocket.file.wavefrontobj.export.shapes.CylinderExporter;
import net.sf.openrocket.file.wavefrontobj.export.shapes.TubeExporter;
import net.sf.openrocket.rocketcomponent.BodyTube;
import net.sf.openrocket.rocketcomponent.FlightConfiguration;
@ -18,6 +17,8 @@ public class BodyTubeExporter extends RocketComponentExporter<BodyTube> {
@Override
public void addToObj() {
obj.setActiveGroupNames(groupName);
final float outerRadius = (float) component.getOuterRadius();
final float innerRadius = (float) component.getInnerRadius();
final float length = (float) component.getLength();
@ -32,7 +33,7 @@ public class BodyTubeExporter extends RocketComponentExporter<BodyTube> {
private void generateMesh(float outerRadius, float innerRadius, float length, boolean isFilled, InstanceContext context) {
// Generate the mesh
int startIdx = obj.getNumVertices();
TubeExporter.addTubeMesh(obj, transformer, groupName, outerRadius, isFilled ? 0 : innerRadius, length, LOD);
TubeExporter.addTubeMesh(obj, transformer, null, outerRadius, isFilled ? 0 : innerRadius, length, LOD);
int endIdx = Math.max(obj.getNumVertices() - 1, startIdx); // Clamp in case no vertices were added
// Translate the mesh to the position in the rocket

View File

@ -19,6 +19,8 @@ public class LaunchLugExporter extends RocketComponentExporter<LaunchLug> {
@Override
public void addToObj() {
obj.setActiveGroupNames(groupName);
final float outerRadius = (float) component.getOuterRadius();
final float innerRadius = (float) component.getInnerRadius();
final float length = (float) component.getLength();
@ -32,7 +34,7 @@ public class LaunchLugExporter extends RocketComponentExporter<LaunchLug> {
private void generateMesh(float outerRadius, float innerRadius, float length, InstanceContext context) {
// Generate the mesh
int startIdx = obj.getNumVertices();
TubeExporter.addTubeMesh(obj, transformer, groupName, outerRadius, innerRadius, length, LOD);
TubeExporter.addTubeMesh(obj, transformer, null, outerRadius, innerRadius, length, LOD);
int endIdx = Math.max(obj.getNumVertices() - 1, startIdx); // Clamp in case no vertices were added
// Translate the mesh to the position in the rocket