Persistent static data for an attach node position for a ModelBaseData. These instances will be copied into the live model data class into an AttachNodeData instance, which includes utility methods for updating the node position and has non-readonly fields for run-time manipulation.
示例#1
0
        public ModelDefinition(ConfigNode node)
        {
            configNode      = node;
            name            = node.GetStringValue("name", String.Empty);
            modelName       = node.GetStringValue("modelName", String.Empty);
            techLimit       = node.GetStringValue("techLimit", techLimit);
            height          = node.GetFloatValue("height", height);
            volume          = node.GetFloatValue("volume", volume);
            mass            = node.GetFloatValue("mass", mass);
            cost            = node.GetFloatValue("cost", cost);
            diameter        = node.GetFloatValue("diameter", diameter);
            verticalOffset  = node.GetFloatValue("verticalOffset", verticalOffset);
            invertForTop    = node.GetBoolValue("invertForTop", invertForTop);
            invertForBottom = node.GetBoolValue("invertForBottom", invertForBottom);

            fairingDisabled       = node.GetBoolValue("fairingDisabled", fairingDisabled);
            fairingTopOffset      = node.GetFloatValue("fairingTopOffset");
            rcsVerticalPosition   = node.GetFloatValue("rcsVerticalPosition", rcsVerticalPosition);
            rcsHorizontalPosition = node.GetFloatValue("rcsHorizontalPosition", rcsHorizontalPosition);
            rcsVerticalRotation   = node.GetFloatValue("rcsVerticalRotation", rcsVerticalRotation);
            rcsHorizontalRotation = node.GetFloatValue("rcsHorizontalRotation", rcsHorizontalRotation);

            defaultTextureSet = node.GetStringValue("defaultTextureSet");

            String[] attachNodeStrings = node.GetValues("node");
            int      len = attachNodeStrings.Length;

            attachNodeData = new AttachNodeBaseData[len];
            for (int i = 0; i < len; i++)
            {
                attachNodeData[i] = new AttachNodeBaseData(attachNodeStrings[i]);
            }

            ConfigNode[] textureSetNodes = node.GetNodes("TEXTURESET");
            len         = textureSetNodes.Length;
            textureSets = new ModelTextureSet[len];
            for (int i = 0; i < len; i++)
            {
                textureSets[i] = new ModelTextureSet(textureSetNodes[i]);
            }
            if (node.HasValue("surface"))
            {
                surfaceNode = new AttachNodeBaseData(node.GetStringValue("surface"));
            }
            else
            {
                String val = (diameter * 0.5f) + ",0,0,1,0,0,2";
                surfaceNode = new AttachNodeBaseData(val);
            }
        }
示例#2
0
        public ModelDefinition(ConfigNode node)
        {
            name = node.GetStringValue("name", String.Empty);
            modelName = node.GetStringValue("modelName", String.Empty);
            techLimit = node.GetStringValue("techLimit", techLimit);
            height = node.GetFloatValue("height", height);
            volume = node.GetFloatValue("volume", volume);
            mass = node.GetFloatValue("mass", mass);
            cost = node.GetFloatValue("cost", cost);
            diameter = node.GetFloatValue("diameter", diameter);
            verticalOffset = node.GetFloatValue("verticalOffset", verticalOffset);
            invertForTop = node.GetBoolValue("invertForTop", invertForTop);
            invertForBottom = node.GetBoolValue("invertForBottom", invertForBottom);

            fairingDisabled = node.GetBoolValue("fairingDisabled", fairingDisabled);
            fairingTopOffset = node.GetFloatValue("fairingTopOffset");
            rcsVerticalPosition = node.GetFloatValue("rcsVerticalPosition", rcsVerticalPosition);
            rcsHorizontalPosition = node.GetFloatValue("rcsHorizontalPosition", rcsHorizontalPosition);
            rcsVerticalRotation = node.GetFloatValue("rcsVerticalRotation", rcsVerticalRotation);
            rcsHorizontalRotation = node.GetFloatValue("rcsHorizontalRotation", rcsHorizontalRotation);

            defaultTextureSet = node.GetStringValue("defaultTextureSet");

            String[] attachNodeStrings = node.GetValues("node");
            int len = attachNodeStrings.Length;
            attachNodeData = new AttachNodeBaseData[len];
            for (int i = 0; i < len; i++)
            {
                attachNodeData[i] = new AttachNodeBaseData(attachNodeStrings[i]);
            }

            ConfigNode[] textureSetNodes = node.GetNodes("TEXTURESET");
            len = textureSetNodes.Length;
            textureSets = new ModelTextureSet[len];
            for (int i = 0; i < len; i++)
            {
                textureSets[i] = new ModelTextureSet(textureSetNodes[i]);
            }
            if (node.HasValue("surface"))
            {
                surfaceNode = new AttachNodeBaseData(node.GetStringValue("surface"));
            }
            else
            {
                String val = (diameter*0.5f) + ",0,0,1,0,0,2";
                surfaceNode = new AttachNodeBaseData(val);
            }
        }
示例#3
0
        public ModelDefinition(ConfigNode node)
        {
            configNode        = node;
            name              = node.GetStringValue("name", String.Empty);
            title             = node.GetStringValue("title", name);
            description       = node.GetStringValue("description", title);
            icon              = node.GetStringValue("icon");
            modelName         = node.GetStringValue("modelName", String.Empty);
            upgradeUnlockName = node.GetStringValue("upgradeUnlock", upgradeUnlockName);
            height            = node.GetFloatValue("height", height);
            volume            = node.GetFloatValue("volume", volume);
            mass              = node.GetFloatValue("mass", mass);
            cost              = node.GetFloatValue("cost", cost);
            diameter          = node.GetFloatValue("diameter", diameter);
            verticalOffset    = node.GetFloatValue("verticalOffset", verticalOffset);
            if (node.GetBoolValue("invertForTop", false))
            {
                orientation = ModelOrientation.BOTTOM;
            }
            else if (node.GetBoolValue("invertForBottom", false))
            {
                orientation = ModelOrientation.TOP;
            }
            invertAxis            = node.GetVector3("invertAxis", invertAxis);
            fairingDisabled       = node.GetBoolValue("fairingDisabled", fairingDisabled);
            fairingTopOffset      = node.GetFloatValue("fairingTopOffset", fairingTopOffset);
            rcsVerticalPosition   = node.GetFloatValue("rcsVerticalPosition", rcsVerticalPosition);
            rcsHorizontalPosition = node.GetFloatValue("rcsHorizontalPosition", rcsHorizontalPosition);
            rcsVerticalRotation   = node.GetFloatValue("rcsVerticalRotation", rcsVerticalRotation);
            rcsHorizontalRotation = node.GetFloatValue("rcsHorizontalRotation", rcsHorizontalRotation);

            ConfigNode[] subModelNodes = node.GetNodes("SUBMODEL");
            int          len           = subModelNodes.Length;

            subModelData = new SubModelData[len];
            for (int i = 0; i < len; i++)
            {
                subModelData[i] = new SubModelData(subModelNodes[i]);
            }

            defaultTextureSet = node.GetStringValue("defaultTextureSet");

            String[] attachNodeStrings = node.GetValues("node");
            len            = attachNodeStrings.Length;
            attachNodeData = new AttachNodeBaseData[len];
            for (int i = 0; i < len; i++)
            {
                attachNodeData[i] = new AttachNodeBaseData(attachNodeStrings[i]);
            }

            ConfigNode[] textureSetNodes = node.GetNodes("TEXTURESET");
            len         = textureSetNodes.Length;
            textureSets = new TextureSet[len];
            for (int i = 0; i < len; i++)
            {
                textureSets[i] = new TextureSet(textureSetNodes[i]);
            }
            if (node.HasValue("surface"))
            {
                surfaceNode = new AttachNodeBaseData(node.GetStringValue("surface"));
            }
            else
            {
                String val = (diameter * 0.5f) + ",0,0,1,0,0,2";
                surfaceNode = new AttachNodeBaseData(val);
            }

            if (node.HasNode("COMPOUNDMODEL"))
            {
                compoundModelData = new CompoundModelData(node.GetNode("COMPOUNDMODEL"));
            }

            if (node.HasNode("ANIMATION"))
            {
                animationData = ModelAnimationData.parseAnimationData(node.GetNodes("ANIMATION"));
            }
            else
            {
                animationData = new ModelAnimationData[0];
            }

            if (node.HasNode("CONSTRAINT"))
            {
                constraintData = node.GetNode("CONSTRAINT");
            }
        }