Beispiel #1
0
        //----------------------------------------------------------------------------
        //----------------------------------------------------------------------------
        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);
        }
Beispiel #2
0
        //----------------------------------------------------------------------------
        //----------------------------------------------------------------------------
        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));
        }