+
+ public class Size3D
+ {
+ private float width;
+ private float height;
+ private float depth;
+
+ public Size3D(float a, float b, float c)
+ {
+ width = a;
+ height = b;
+ depth = c;
+ }
+
+ public Size3D()
+ {
+ width = 0.0f;
+ height = 0.0f;
+ depth = 0.0f;
+ }
+
+ public Size3D(Vector3 o)
+ {
+ width = o.X;
+ height = o.Y;
+ depth = o.Z;
+ }
+
+ public Size3D(Vector2 o)
+ {
+ width = o.X;
+ height = o.Y;
+ depth = 0.0f;
+ }
+
+ public Size3D(Size3D a)
+ {
+ width = a.width;
+ height = a.height;
+ depth = a.depth;
+ }
+
+ public float W
+ {
+ get { return width; }
+ set { width = value; }
+ }
+
+ public float H
+ {
+ get { return height; }
+ set { height = value; }
+ }
+
+ public float D
+ {
+ get { return depth; }
+ set { depth = value; }
+ }
+
+ public float Width
+ {
+ get { return width; }
+ set { width = value; }
+ }
+
+ public float Height
+ {
+ get { return height; }
+ set { height = value; }
+ }
+
+ public float Depth
+ {
+ get { return depth; }
+ set { depth = value; }
+ }
+
+ public float X
+ {
+ get { return width; }
+ set { width = value; }
+ }
+
+ public float Y
+ {
+ get { return height; }
+ set { height = value; }
+ }
+
+ public float Z
+ {
+ get { return depth; }
+ set { depth = value; }
+ }
+
+ // User-defined conversion from Position to Vector3
+ public static implicit operator Vector3(Size3D size)
+ {
+ return new Vector3(size.width, size.height, size.depth);
+ }
+
+ public static implicit operator Size3D(Vector3 vec)
+ {
+ return new Size3D(vec.X, vec.Y, vec.Z);
+ }
+
+ }
+