private int CreateContactPoints(List <Bounds> xjBoundsList)//创建接触点,把中心相同的接触点合并
    {
        var boundsList = MergeSameCenterBounds(xjBoundsList);

        boundsList = MergeContactPointsToMaxNum(boundsList);
        objManager.Log("contactPoint Num:" + boundsList.Count);
        foreach (var item in boundsList)
        {
            objManager.CreateContactPointSphere(item.center, item.extents);
        }
        Debug.Log("old length: " + xjBoundsList.Count);
        Debug.Log("new length: " + boundsList.Count);
        return(boundsList.Count);
    }
Esempio n. 2
0
 public void ButtonAddSphereOnClick()
 {
     objManager.CreateContactPointSphere(new Vector3(0, 0, 0), 0.5f);//创建一个原点为中心,半径0.5的球
 }