//---------------------------------------------------------------------------- //---------------------------------------------------------------------------- internal bool GetMaterialPair(Material one, Material two, out MaterialCollisionItem pair) { bool bResult = false; int nKey = MaterialPair.GetMaterialPairHashKey(one, two); if (m_materialPairs.TryGetValue(nKey, out pair)) { bResult = true; } return(bResult); }
//---------------------------------------------------------------------------- //---------------------------------------------------------------------------- public MaterialPairKey AddMaterialPair(Material materialOne, Material materialTwo, MatCollCallBack callBack) { MaterialCollisionItem pair; int nKey = MaterialPair.GetMaterialPairHashKey(materialOne, materialTwo); if (m_materialPairs.TryGetValue(nKey, out pair)) { pair.AddCallback(callBack); } else { pair = new MaterialCollisionItem(materialOne, materialTwo, callBack); } return(new MaterialPairKey(nKey)); }