void AddMesh(MyMesh mesh) { Debug.Assert(IsMergable(mesh)); // add to my big mesh // get info }
internal static void TestModel(MyMesh mesh) { if (m_test == null) { m_test = new MyMergeInstancing(); m_test.m_rootMaterial = MyAssetsLoader.GetModel("Models//Cubes//Large//StoneCube.mwm").LODs[0].m_meshInfo.m_submeshes[MyMesh.DEFAULT_MESH_TECHNIQUE][0].Material; } if (m_test.IsMergable(mesh)) { Debug.WriteLine(String.Format("{0} mergable: {1}", mesh.Name, m_test.IsMergable(mesh))); } }
internal bool IsMergable(MyMesh mesh) { // check if one and only spoorted vertex format // check if same material as the rest // check if has one part(!) // check if has one lod - for now return (mesh.LODs.Length == 1 && mesh.LODs[0].m_meshInfo.PartsNum == 1 && mesh.LODs[0].m_meshInfo.VertexLayout == MyMeshTableSRV.OneAndOnlySupportedVertexLayout && MyMaterials.AreMergable(mesh.LODs[0].m_meshInfo.m_submeshes[MyMesh.DEFAULT_MESH_TECHNIQUE][0].Material, m_rootMaterial)); }
internal bool IsMergable(MyMesh mesh) { return(mesh.LODs[0].m_meshInfo.VertexLayout == OneAndOnlySupportedVertexLayout); }
internal bool IsMergable(MyMesh mesh) { return mesh.LODs[0].m_meshInfo.VertexLayout == OneAndOnlySupportedVertexLayout; }
internal bool IsMergable(MyMesh mesh) { // check if one and only spoorted vertex format // check if same material as the rest // check if has one part(!) // check if has one lod - for now return mesh.LODs.Length == 1 && mesh.LODs[0].m_meshInfo.PartsNum == 1 && mesh.LODs[0].m_meshInfo.VertexLayout == MyMeshTableSRV.OneAndOnlySupportedVertexLayout && MyMaterials.AreMergable(mesh.LODs[0].m_meshInfo.m_submeshes[MyMesh.DEFAULT_MESH_TECHNIQUE][0].Material, m_rootMaterial); }