Пример #1
0
        void DestroyGeomDatas()
        {
            if (geomDatas != null)
            {
                foreach (GeomData geomData in geomDatas)
                {
                    if (geomData == null)
                    {
                        continue;
                    }

                    dGeomID geomID = geomData.transformID != dGeomID.Zero ?
                                     geomData.transformID : geomData.geomID;
                    Ode.DestroyShapeData(geomID);

                    scene.shapesDictionary.Remove(geomData.shapeDictionaryIndex);

                    if (geomData.transformID != dGeomID.Zero)
                    {
                        Ode.dGeomDestroy(geomData.transformID);
                    }

                    if (geomData.meshGeometryODEData != null)
                    {
                        geomData.meshGeometryODEData.checkRefCounter--;
                        if (geomData.meshGeometryODEData.checkRefCounter < 0)
                        {
                            Log.Fatal("ODEBody: DestroyGeomDatas: Mesh geometry counter < 0.");
                        }
                    }

                    Ode.dGeomDestroy(geomData.geomID);
                }
            }
            geomDatas = null;
        }