private void updateModels() { currentMainTankModule.updateModel(); currentNoseModule.updateModel(); currentMountModule.updateModel(); SSTUModInterop.onPartGeometryUpdate(part, true); }
private void updateModulePositions() { //update for model scale topDockModule.updateScale(1); topModule.updateScaleForDiameter(topDiameter); coreModule.updateScaleForDiameter(coreDiameter); bottomModule.updateScaleForDiameter(bottomDiameter); bottomDockModule.updateScale(1); //calc positions float yPos = topModule.currentHeight + (coreModule.currentHeight * 0.5f); float topDockY = yPos; yPos -= topModule.currentHeight; float topY = yPos; yPos -= coreModule.currentHeight; float coreY = yPos; float bottomY = coreY; yPos -= bottomModule.currentHeight; float bottomDockY = yPos; //update internal ref of position topDockModule.setPosition(topDockY); topModule.setPosition(topY); coreModule.setPosition(coreY); bottomModule.setPosition(bottomY, ModelOrientation.BOTTOM); bottomDockModule.setPosition(bottomDockY, ModelOrientation.BOTTOM); //update actual model positions and scales topDockModule.updateModel(); topModule.updateModel(); coreModule.updateModel(); bottomModule.updateModel(); bottomDockModule.updateModel(); solarModule.updateModelPosition(coreModule.currentVerticalPosition); Vector3 pos = new Vector3(0, topDockY + topDockModule.currentHeight, 0); topDockTransform.localPosition = pos; topControlTransform.localPosition = pos; pos = new Vector3(0, bottomDockY - bottomDockModule.currentHeight, 0); bottomDockTransform.localPosition = pos; bottomControlTransform.localPosition = pos; }
private void setModelDiameter(float diameter) { mainModelData.updateScaleForDiameter(diameter); mainModelData.currentVerticalPosition = mainModelData.currentHeight * 0.5f + mainModelData.modelDefinition.verticalOffset * mainModelData.currentHeightScale; mainModelData.updateModel(); }