public CarBalltreeMeshes GetBalltreeMeshes(CRBalltreeAsset btAsset) { if (!dictionaryBalltreeMeshes.ContainsKey(btAsset)) { CarBalltreeMeshes btMeshes = CreateBalltreeMeshes(btAsset); dictionaryBalltreeMeshes.Add(btAsset, btMeshes); } return(dictionaryBalltreeMeshes[btAsset]); }
private CarBalltreeMeshes CreateBalltreeMeshes(CRBalltreeAsset btAsset) { CarBalltreeMeshes btMeshes = new CarBalltreeMeshes(); CarSphere[] arrSphere = btAsset.LeafSpheres; int arrSphere_size = arrSphere.Length; for (uint i = 0; i < arrSphere_size; i++) { CarSphere sphere = arrSphere[i]; btMeshes.AddSphere(CarColor.ColorBasic42(i), sphere.center_, sphere.radius_); } btMeshes.FinishAddingSpheres(); return(btMeshes); }