Пример #1
0
        public void toggleNode()
        {
            AttachNode node = part.FindAttachNode(nodeName);

            ROTLog.debug("toggleNode() node: " + node);
            if (node == null)
            {
                currentlyEnabled = true;
                ROTAttachNodeUtils.createAttachNode(part, nodeName, nodeDefaultPosition, nodeDefaultOrientation, 2);
            }
            else if (node.attachedPart == null)
            {
                currentlyEnabled = false;
                ROTAttachNodeUtils.destroyAttachNode(part, node);
            }
        }
Пример #2
0
        /// <summary>
        /// Return the total height of this part in its current configuration.  This will be the distance from the bottom attach node to the top attach node, and may not include any 'extra' structure. TOOLING
        /// </summary>
        /// <returns></returns>
        private float getTotalHeight()
        {
            float totalHeight = noseModule.moduleHeight;

            totalHeight += mountModule.moduleHeight;
            ROTLog.debug("currentCore: " + currentCore);
            if (currentCore.Contains("Booster"))
            {
                ROTLog.debug("currentCore: " + currentCore);
                totalHeight += coreModule.moduleActualHeight;
            }
            else
            {
                totalHeight += coreModule.moduleHeight;
            }
            return(totalHeight);
        }
Пример #3
0
        /// <summary>
        /// Updates all dimensions for the PAW and tooling.
        /// </summary>
        private void updateDimensions()
        {
            float noseMaxDiam, mountMaxDiam = 0.0f;

            noseMaxDiam = Math.Max(noseModule.moduleLowerDiameter, noseModule.moduleUpperDiameter);
            ROTLog.debug("currentMount: " + currentMount);
            if (currentMount.Contains("Mount"))
            {
                ROTLog.debug("currentMount: " + currentMount);
                mountMaxDiam = mountModule.moduleUpperDiameter;
            }
            else
            {
                mountMaxDiam = Math.Max(mountModule.moduleLowerDiameter, mountModule.moduleUpperDiameter);
            }

            totalTankLength = getTotalHeight();
            ROTLog.debug("The Total Tank Length is: " + totalTankLength);
            largestDiameter = Math.Max(currentDiameter, Math.Max(noseMaxDiam, mountMaxDiam));
        }