Пример #1
0
 ////////////////////////////////////////////////////////////////////////
 /// <summary> A box constructor that initializes the data </summary>
 /// <param name="x"> The x position of the box </param>
 /// <param name="y"> The y position of the box </param>
 /// <param name="z"> The z position of the box </param>
 /// <param name="width"> The width of the box </param>
 /// <param name="height"> The height of the box </param>
 /// <param name="depth"> The depth of the box </param>
 ////////////////////////////////////////////////////////////////////////
 public Box3(float x, float y, float z, float width, float height, float depth)
 {
     // The fields must be fully initialized in C#, so we can't call Set
     pos  = new Point3(x, y, z);
     dims = new Vector3(width, height, depth);
 }
Пример #2
0
 ////////////////////////////////////////////////////////////////////////
 /// <summary>
 /// Construct a pox from a position and size
 /// </summary>
 /// <param name="inPos"> The position of the box </param>
 /// <param name="inSize"> The size of the box </param>
 ////////////////////////////////////////////////////////////////////////
 public Box3(Point3 inPos, Vector3 inSize)
 {
     pos  = inPos;
     dims = inSize;
 }
Пример #3
0
 ////////////////////////////////////////////////////////////////////////
 /// <summary>
 /// Construct a pox from 2 points
 /// </summary>
 /// <param name="pt1"> One point on the box </param>
 /// <param name="pt2"> The opposite corner on the box from pt1 </param>
 ////////////////////////////////////////////////////////////////////////
 public Box3(Point3 pt1, Point3 pt2)
 {
     pos  = pt1;
     dims = pt2 - pt1;
 }
Пример #4
0
 ////////////////////////////////////////////////////////////////////////
 /// <summary> A copy constructor </summary>
 /// <param name="copy"> The box to copy </param>
 ////////////////////////////////////////////////////////////////////////
 public Box3(Box3 copy)
 {
     pos = copy.pos; dims = copy.dims;
 }