Ejemplo n.º 1
0
        /// <summary>
        /// Update 'dorsal' attach node(s) (all others handled by base MFT code)
        /// </summary>
        /// <param name="userInput"></param>
        protected override void updateAttachNodes(bool userInput)
        {
            //handle cap/mount/surface attach nodes through base code
            base.updateAttachNodes(userInput);
            //internal dorsal node
            if (currentMainTankModule.modelDefinition.attachNodeData.Length > 0)
            {
                AttachNode node = part.findAttachNode("dorsal");
                if (node == null)
                {
                    return;
                }
                AttachNodeBaseData d   = currentMainTankModule.modelDefinition.attachNodeData[0];
                Vector3            pos = d.position * currentMainTankModule.currentDiameterScale;
                SSTUAttachNodeUtils.updateAttachNodePosition(part, node, pos, d.orientation, userInput);
            }
            //internal front/rear nodes
            float height = currentMainTankModule.currentHeight + (currentMainTankModule.modelDefinition.fairingTopOffset * 2f * currentMainTankModule.currentHeightScale);

            height *= 0.5f;
            AttachNode front = part.findAttachNode("front");

            if (front != null)
            {
                Vector3 pos = new Vector3(0, height, 0);
                SSTUAttachNodeUtils.updateAttachNodePosition(part, front, pos, Vector3.down, userInput);
            }
            AttachNode rear = part.findAttachNode("rear");

            if (rear != null)
            {
                Vector3 pos = new Vector3(0, -height, 0);
                SSTUAttachNodeUtils.updateAttachNodePosition(part, rear, pos, Vector3.up, userInput);
            }
        }
        private void updateNodePositions(bool userInput)
        {
            float h = currentHeight * 0.5f;

            SSTUAttachNodeUtils.updateAttachNodePosition(part, part.findAttachNode("top"), new Vector3(0, h, 0), Vector3.up, userInput);
            SSTUAttachNodeUtils.updateAttachNodePosition(part, part.findAttachNode("bottom"), new Vector3(0, -h, 0), Vector3.down, userInput);
        }
Ejemplo n.º 3
0
        private void updateAttachNodes(bool userInput)
        {
            AttachNode surface = part.srfAttachNode;

            if (surface != null)
            {
                Vector3 pos = new Vector3(surfaceNodeX * getScale(), 0, 0);
                SSTUAttachNodeUtils.updateAttachNodePosition(part, surface, pos, surface.orientation, userInput);
            }
        }
Ejemplo n.º 4
0
        private void updateAttachNodes(bool userInput)
        {
            AttachNode surface = part.srfAttachNode;
            int        size    = Mathf.RoundToInt(diameter / 2);

            if (surface != null)
            {
                Vector3 pos = new Vector3(surfaceNodeX * getScale(), 0, 0);
                SSTUAttachNodeUtils.updateAttachNodePosition(part, surface, pos, surface.orientation, userInput, size);
            }
        }