コード例 #1
0
        internal void RenderHeightMap()
        {
#if COLLIDER_ODE
            ComputeLandingHeights();
#else
            //todo is silly to lock?            lock (this)
            //if (!Monitor.TryEnter(this, 10))
            //{
            //    SimPathStore.Debug("Someone is locking? " + this);
            //}
            //lock (this)
            {
                if (!HeightMapNeedsUpdate)
                {
                    return;
                }
                HeightMapNeedsUpdate = false;
            }
            //            _HeightMap = null;
            RenderGroundPlane();
            Debug("Start RenderHeightMap: {0} for {1}", PathStore, this);
            CollisionIndex[,] MeshIndex = PathStore.MeshIndex;
            MatrixNeedsUpdate           = true;
            //byte[,] ToMatrix = ByteMatrix;
            float[,] Heights     = HeightMap;
            float[,] GroundPlane = PathStore.GroundPlane;
            PathStore.TaintMatrix();
            for (int y = MaxYPt; y >= 0; y--)
            {
                for (int x = MaxXPt; x >= 0; x--)
                {
                    Heights[x, y] = DefaultHeight(y, x, GroundPlane, Heights, MeshIndex);
                }
            }
#endif
            Debug("End RenderHeightMap: {0} for {1}", PathStore, this);
        }