This repository was archived by the owner on Mar 30, 2019. It is now read-only.
File tree Expand file tree Collapse file tree
Source/SharpDX.Mathematics Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,6 +77,46 @@ public BoundingBox(Vector3 minimum, Vector3 maximum)
7777 this . Maximum = maximum ;
7878 }
7979
80+ /// <summary>
81+ /// Returns the width of the bounding box
82+ /// </summary>
83+ public float Width
84+ {
85+ get { return this . Maximum . X - this . Minimum . X ; }
86+ }
87+
88+ /// <summary>
89+ /// Returns the height of the bounding box
90+ /// </summary>
91+ public float Height
92+ {
93+ get { return this . Maximum . Y - this . Minimum . Y ; }
94+ }
95+
96+ /// <summary>
97+ /// Returns the height of the bounding box
98+ /// </summary>
99+ public float Depth
100+ {
101+ get { return this . Maximum . Z - this . Minimum . Z ; }
102+ }
103+
104+ /// <summary>
105+ /// Returns the size of the bounding box
106+ /// </summary>
107+ public Vector3 Size
108+ {
109+ get { return this . Maximum - this . Minimum ; }
110+ }
111+
112+ /// <summary>
113+ /// Returns the size of the bounding box
114+ /// </summary>
115+ public Vector3 Center
116+ {
117+ get { return this . Minimum + ( this . Maximum - this . Minimum ) * 0.5f ; }
118+ }
119+
80120 /// <summary>
81121 /// Retrieves the eight corners of the bounding box.
82122 /// </summary>
You can’t perform that action at this time.
0 commit comments