/// <summary>
        /// Initialization
        /// </summary>
        /// <param name="device"></param>
        /// <param name="physicsEngine"></param>
        public override void Initialize(xnagrfx.GraphicsDevice device, PhysicsEngine physicsEngine)
        {
            try
            {
                InitError = string.Empty;
                // set flag so rendering engine renders us last
                Flags |= VisualEntityProperties.UsesAlphaBlending;

                // creates effect, loads meshes, etc
                base.Initialize(device, physicsEngine);

                HeightFieldShapeProperties hf = new HeightFieldShapeProperties("height field", 2, 0.02f, 2, 0.02f, 0, 0, 1, 1);
                hf.HeightSamples = new HeightFieldSample[hf.RowCount * hf.ColumnCount];
                for (int i = 0; i < hf.HeightSamples.Length; i++)
                {
                    hf.HeightSamples[i] = new HeightFieldSample();
                }

                _particlePlane            = new Shape(hf);
                _particlePlane.State.Name = "sonar impact plane";

                VisualEntityMesh sonarMesh = null;

                // we render on our own only the laser impact points. The laser Box is rendered as part of the parent.
                int index = Meshes.Count;
                Meshes.Add(SimulationEngine.ResourceCache.CreateMesh(device, _particlePlane.State));
                Meshes[0].Textures[0] = SimulationEngine.ResourceCache.CreateTextureFromFile(device, "particle.bmp");

                // we have a custom effect, with an additional global parameter. Get handle to it here
                if (Effect != null)
                {
                    _timeAttenuationHandle = Effect.GetParameter("timeAttenuation");
                }

                World = xna.Matrix.Identity;
                if (Meshes.Count > 1)
                {
                    sonarMesh = Meshes[0];
                }

                if (Parent == null)
                {
                    throw new Exception("This entity must be a child of another entity.");
                }

                Parent.AddShapeToPhysicsEntity(_sonarBox, sonarMesh);
            }
            catch (Exception ex)
            {
                HasBeenInitialized = false;
                InitError          = ex.ToString();
            }
        }
        /// <summary>
        /// Initialization
        /// </summary>
        /// <param name="device"></param>
        /// <param name="physicsEngine"></param>
        public override void Initialize(xnagrfx.GraphicsDevice device, PhysicsEngine physicsEngine)
        {
            try
            {
                InitError = string.Empty;
                // set flag so rendering engine renders us last
                Flags |= VisualEntityProperties.UsesAlphaBlending;

                // creates effect, loads meshes, etc
                base.Initialize(device, physicsEngine);

                HeightFieldShapeProperties hf = new HeightFieldShapeProperties("height field", 2, 0.02f, 2, 0.02f, 0, 0, 1, 1);
                hf.HeightSamples = new HeightFieldSample[hf.RowCount * hf.ColumnCount];
                for (int i = 0; i < hf.HeightSamples.Length; i++)
                    hf.HeightSamples[i] = new HeightFieldSample();

                _particlePlane = new Shape(hf);
                _particlePlane.State.Name = "sonar impact plane";

                VisualEntityMesh sonarMesh = null;

                // we render on our own only the laser impact points. The laser Box is rendered as part of the parent.
                int index = Meshes.Count;
                Meshes.Add(SimulationEngine.ResourceCache.CreateMesh(device, _particlePlane.State));
                Meshes[0].Textures[0] = SimulationEngine.ResourceCache.CreateTextureFromFile(device, "particle.bmp");

                // we have a custom effect, with an additional global parameter. Get handle to it here
                if (Effect != null)
                    _timeAttenuationHandle = Effect.GetParameter("timeAttenuation");

                World = xna.Matrix.Identity;
                if (Meshes.Count > 1)
                    sonarMesh = Meshes[0];

                if (Parent == null)
                    throw new Exception("This entity must be a child of another entity.");

                Parent.AddShapeToPhysicsEntity(_sonarBox, sonarMesh);
            }
            catch (Exception ex)
            {
                HasBeenInitialized = false;
                InitError = ex.ToString();
            }
        }