MyGame.Camera.BoundingVolumeIsInView C# (CSharp) Method

BoundingVolumeIsInView() public method

Checks if the bounding box is in the camera frustrum or not
public BoundingVolumeIsInView ( Microsoft.Xna.Framework.BoundingBox box ) : bool
box Microsoft.Xna.Framework.BoundingBox the Bounding box to check
return bool
        public bool BoundingVolumeIsInView(BoundingBox box)
        {
            return (Frustum.Contains(box) != ContainmentType.Disjoint);
        }

Same methods

Camera::BoundingVolumeIsInView ( BoundingSphere sphere ) : bool

Usage Example

Example #1
0
        // Called when the game should draw itself
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.Black);

            foreach (CModel model in models)
            {
                if (camera.BoundingVolumeIsInView(model.BoundingSphere))
                {
                    model.Draw(camera.View, camera.Projection, ((FreeCamera)camera).Position);
                }
            }

            base.Draw(gameTime);
        }
All Usage Examples Of MyGame.Camera::BoundingVolumeIsInView