示例#1
0
        public bool SetInstanceMaterial(string materialName, MyInstanceMaterial instanceMaterial)
        {
            int instanceMaterialOffset = StandardModel.GetInstanceMaterialOffset(materialName);

            if (instanceMaterialOffset == -1)
            {
                return(false);
            }

            m_instanceMaterials.Set(instanceMaterialOffset, instanceMaterial);
            return(true);
        }
示例#2
0
        public bool SetInstanceMaterialEmissivity(string materialName, float emissivity)
        {
            int instanceMaterialOffset = StandardModel.GetInstanceMaterialOffset(materialName);

            if (instanceMaterialOffset == -1)
            {
                return(false);
            }

            MyInstanceMaterial instanceMaterial = m_instanceMaterials.Get(instanceMaterialOffset);

            instanceMaterial.Emissivity = emissivity;
            m_instanceMaterials.Set(instanceMaterialOffset, instanceMaterial);
            return(true);
        }
示例#3
0
        public bool SetInstanceMaterialColorMult(string materialName, Vector3 colorMult)
        {
            int instanceMaterialOffset = StandardModel.GetInstanceMaterialOffset(materialName);

            if (instanceMaterialOffset == -1)
            {
                return(false);
            }

            MyInstanceMaterial instanceMaterial = m_instanceMaterials.Get(instanceMaterialOffset);

            instanceMaterial.ColorMult = colorMult;
            m_instanceMaterials.Set(instanceMaterialOffset, instanceMaterial);
            return(true);
        }
示例#4
0
        public void SetGlobalEmissivity(float emissivity)
        {
            MyInstanceMaterial instanceMaterial = MyInstanceMaterial.Default;

            instanceMaterial.Emissivity = emissivity;

            // Set emissivity for parts, that are not instanced:
            GlobalColorMultEmissivity = new HalfVector4(1, 1, 1, emissivity);

            // Fill emissivity to all parts, that are not explictly set
            for (int i = 0; i < m_instanceMaterials.GetSize(); i++)
            {
                if (!m_instanceMaterials.IsExplicitlySet(i))
                {
                    m_instanceMaterials.Set(i, instanceMaterial);
                }
            }
        }
示例#5
0
 public void Set(int index, MyInstanceMaterial instanceMaterial)
 {
     m_instanceMaterials[index]         = instanceMaterial;
     m_explicitInstanceMaterials[index] = true;
 }