#region File Description //----------------------------------------------------------------------------- // CollideBox.cs // // Microsoft XNA Community Game Platform // Copyright (C) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- #endregion #region Using Statements using System; using System.Collections.Generic; using System.Text; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; #endregion namespace RobotGameData.Collision { /// /// It's a collision box. /// public class CollideBox : CollideElement { #region Fields /// /// min local position of the bounding box /// protected Vector3 localMin = Vector3.Zero; /// /// max local position of the bounding box /// protected Vector3 localMax = Vector3.Zero; /// /// Bounding box /// protected BoundingBox boundingBox; #endregion #region Properties public BoundingBox BoundingBox { get { return boundingBox; } } #endregion /// /// Constructor. /// /// min size of the box /// max size of the box public CollideBox(Vector3 min, Vector3 max) : base() { localMin = min; localMax = max; boundingBox = new BoundingBox(localMin, localMax); } /// /// Transform the bounding box. /// public override void Transform(Matrix matrix) { boundingBox.Min = Vector3.Transform(localMin, matrix); boundingBox.Max = Vector3.Transform(localMax, matrix); base.Transform(matrix); } } }