Exemple #1
0
        /// <summary>
        /// <see cref="Contains(Rectangle)"/> checks whether or not a <see cref="Microsoft.Xna.Framework.Rectangle"/> is contained within the <see cref="BoundingBox"/> of the CameraComponent.
        /// </summary>
        public ContainmentType Contains(Rectangle rectangle)
        {
            var max         = new Vector3(rectangle.X + rectangle.Width, rectangle.Y + rectangle.Height, 0.5f);
            var min         = new Vector3(rectangle.X, rectangle.Y, 0.5f);
            var boundingBox = new BoundingBox(min.MonoGameVector, max.MonoGameVector);

            return(BoundingFrustum.Contains(boundingBox));
        }
        public void FindAll(Microsoft.Xna.Framework.BoundingFrustum boundingFrustum, ICollection <ISpatialQueryable> result)
        {
            var count = list.Count;

            for (int i = 0; i < count; i++)
            {
                result.Add(list[i]);
            }
        }
        private void updatePlanes(Matrix viewProjection)
        {
            var xnaFrustum = new Microsoft.Xna.Framework.BoundingFrustum(viewProjection.xna());

            Planes[0] = xnaFrustum.Bottom.dx();
            Planes[1] = xnaFrustum.Top.dx();
            Planes[2] = xnaFrustum.Right.dx();
            Planes[3] = xnaFrustum.Left.dx();
            Planes[4] = xnaFrustum.Near.dx();
            Planes[5] = xnaFrustum.Far.dx();
        }
        public void FindAll(Microsoft.Xna.Framework.BoundingFrustum boundingFrustum, ICollection <ISpatialQueryable> result)
        {
            var count = list.Count;

            for (int i = 0; i < count; i++)
            {
                if (boundingFrustum.Contains(list[i].BoundingBox) != Microsoft.Xna.Framework.ContainmentType.Disjoint)
                {
                    result.Add(list[i]);
                }
            }
        }
Exemple #5
0
 public void UpdateVisibility(Matrix viewProjection)
 {
     tempFrustum = new Microsoft.Xna.Framework.BoundingFrustum(viewProjection.xna());
     UpdateVisibility(new BoundingFrustum(viewProjection));
 }
Exemple #6
0
 /// <summary>
 /// Checks whether or not a Komodo.Lib.Math.Vector2 is contained within the <see cref="BoundingFrustum"/> of the CameraComponent.
 /// </summary>
 public ContainmentType Contains(Vector2 vector)
 {
     return(BoundingFrustum.Contains(new Vector3(vector.X, vector.Y, 0).MonoGameVector));
 }