public bool SetInstanceMaterial(string materialName, MyInstanceMaterial instanceMaterial) { int instanceMaterialOffset = StandardModel.GetInstanceMaterialOffset(materialName); if (instanceMaterialOffset == -1) { return(false); } m_instanceMaterials.Set(instanceMaterialOffset, instanceMaterial); return(true); }
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); }
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); }
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); } } }
public void Set(int index, MyInstanceMaterial instanceMaterial) { m_instanceMaterials[index] = instanceMaterial; m_explicitInstanceMaterials[index] = true; }