2017-11-17 03:09:00 +01:00
|
|
|
// file: core/math/aabb.h
|
2017-11-05 11:37:59 +01:00
|
|
|
// commit: 7ad14e7a3e6f87ddc450f7e34621eb5200808451
|
2017-11-17 03:09:00 +01:00
|
|
|
// file: core/math/aabb.cpp
|
2017-11-05 11:37:59 +01:00
|
|
|
// commit: bd282ff43f23fe845f29a3e25c8efc01bd65ffb0
|
|
|
|
// file: core/variant_call.cpp
|
|
|
|
// commit: 5ad9be4c24e9d7dc5672fdc42cea896622fe5685
|
2018-04-08 05:28:24 +02:00
|
|
|
using System;
|
2018-03-01 08:51:35 +01:00
|
|
|
#if REAL_T_IS_DOUBLE
|
|
|
|
using real_t = System.Double;
|
|
|
|
#else
|
|
|
|
using real_t = System.Single;
|
|
|
|
#endif
|
|
|
|
|
2017-11-05 11:37:59 +01:00
|
|
|
namespace Godot
|
|
|
|
{
|
2017-11-17 03:09:00 +01:00
|
|
|
public struct AABB : IEquatable<AABB>
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
|
|
|
private Vector3 position;
|
|
|
|
private Vector3 size;
|
|
|
|
|
|
|
|
public Vector3 Position
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return position;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public Vector3 Size
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return size;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public Vector3 End
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return position + size;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-21 23:32:19 +01:00
|
|
|
public bool Encloses(AABB with)
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
|
|
|
Vector3 src_min = position;
|
|
|
|
Vector3 src_max = position + size;
|
|
|
|
Vector3 dst_min = with.position;
|
|
|
|
Vector3 dst_max = with.position + with.size;
|
|
|
|
|
2018-04-08 05:39:35 +02:00
|
|
|
return src_min.x <= dst_min.x &&
|
|
|
|
src_max.x > dst_max.x &&
|
|
|
|
src_min.y <= dst_min.y &&
|
|
|
|
src_max.y > dst_max.y &&
|
|
|
|
src_min.z <= dst_min.z &&
|
|
|
|
src_max.z > dst_max.z;
|
2017-11-05 11:37:59 +01:00
|
|
|
}
|
|
|
|
|
2017-11-21 23:32:19 +01:00
|
|
|
public AABB Expand(Vector3 to_point)
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
|
|
|
Vector3 begin = position;
|
|
|
|
Vector3 end = position + size;
|
|
|
|
|
|
|
|
if (to_point.x < begin.x)
|
|
|
|
begin.x = to_point.x;
|
|
|
|
if (to_point.y < begin.y)
|
|
|
|
begin.y = to_point.y;
|
|
|
|
if (to_point.z < begin.z)
|
|
|
|
begin.z = to_point.z;
|
|
|
|
|
|
|
|
if (to_point.x > end.x)
|
|
|
|
end.x = to_point.x;
|
|
|
|
if (to_point.y > end.y)
|
|
|
|
end.y = to_point.y;
|
|
|
|
if (to_point.z > end.z)
|
|
|
|
end.z = to_point.z;
|
|
|
|
|
2017-11-17 03:09:00 +01:00
|
|
|
return new AABB(begin, end - begin);
|
2017-11-05 11:37:59 +01:00
|
|
|
}
|
|
|
|
|
2018-03-01 08:51:35 +01:00
|
|
|
public real_t GetArea()
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
|
|
|
return size.x * size.y * size.z;
|
|
|
|
}
|
|
|
|
|
2017-11-21 23:32:19 +01:00
|
|
|
public Vector3 GetEndpoint(int idx)
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
|
|
|
switch (idx)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
return new Vector3(position.x, position.y, position.z);
|
|
|
|
case 1:
|
|
|
|
return new Vector3(position.x, position.y, position.z + size.z);
|
|
|
|
case 2:
|
|
|
|
return new Vector3(position.x, position.y + size.y, position.z);
|
|
|
|
case 3:
|
|
|
|
return new Vector3(position.x, position.y + size.y, position.z + size.z);
|
|
|
|
case 4:
|
|
|
|
return new Vector3(position.x + size.x, position.y, position.z);
|
|
|
|
case 5:
|
|
|
|
return new Vector3(position.x + size.x, position.y, position.z + size.z);
|
|
|
|
case 6:
|
|
|
|
return new Vector3(position.x + size.x, position.y + size.y, position.z);
|
|
|
|
case 7:
|
|
|
|
return new Vector3(position.x + size.x, position.y + size.y, position.z + size.z);
|
|
|
|
default:
|
|
|
|
throw new ArgumentOutOfRangeException(nameof(idx), String.Format("Index is {0}, but a value from 0 to 7 is expected.", idx));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-21 23:32:19 +01:00
|
|
|
public Vector3 GetLongestAxis()
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
2018-04-08 05:30:43 +02:00
|
|
|
var axis = new Vector3(1f, 0f, 0f);
|
2018-04-17 00:53:27 +02:00
|
|
|
real_t max_size = size.x;
|
2017-11-05 11:37:59 +01:00
|
|
|
|
|
|
|
if (size.y > max_size)
|
|
|
|
{
|
|
|
|
axis = new Vector3(0f, 1f, 0f);
|
|
|
|
max_size = size.y;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (size.z > max_size)
|
|
|
|
{
|
|
|
|
axis = new Vector3(0f, 0f, 1f);
|
|
|
|
}
|
|
|
|
|
|
|
|
return axis;
|
|
|
|
}
|
|
|
|
|
2017-11-21 23:32:19 +01:00
|
|
|
public Vector3.Axis GetLongestAxisIndex()
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
2018-04-08 05:30:43 +02:00
|
|
|
var axis = Vector3.Axis.X;
|
2018-03-01 08:51:35 +01:00
|
|
|
real_t max_size = size.x;
|
2017-11-05 11:37:59 +01:00
|
|
|
|
|
|
|
if (size.y > max_size)
|
|
|
|
{
|
|
|
|
axis = Vector3.Axis.Y;
|
|
|
|
max_size = size.y;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (size.z > max_size)
|
|
|
|
{
|
|
|
|
axis = Vector3.Axis.Z;
|
|
|
|
}
|
|
|
|
|
|
|
|
return axis;
|
|
|
|
}
|
|
|
|
|
2018-03-01 08:51:35 +01:00
|
|
|
public real_t GetLongestAxisSize()
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
2018-04-17 00:53:27 +02:00
|
|
|
real_t max_size = size.x;
|
2017-11-05 11:37:59 +01:00
|
|
|
|
|
|
|
if (size.y > max_size)
|
|
|
|
max_size = size.y;
|
|
|
|
|
|
|
|
if (size.z > max_size)
|
|
|
|
max_size = size.z;
|
|
|
|
|
|
|
|
return max_size;
|
|
|
|
}
|
|
|
|
|
2017-11-21 23:32:19 +01:00
|
|
|
public Vector3 GetShortestAxis()
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
2018-04-08 05:30:43 +02:00
|
|
|
var axis = new Vector3(1f, 0f, 0f);
|
2018-04-17 00:53:27 +02:00
|
|
|
real_t max_size = size.x;
|
2017-11-05 11:37:59 +01:00
|
|
|
|
|
|
|
if (size.y < max_size)
|
|
|
|
{
|
|
|
|
axis = new Vector3(0f, 1f, 0f);
|
|
|
|
max_size = size.y;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (size.z < max_size)
|
|
|
|
{
|
|
|
|
axis = new Vector3(0f, 0f, 1f);
|
|
|
|
}
|
|
|
|
|
|
|
|
return axis;
|
|
|
|
}
|
|
|
|
|
2017-11-21 23:32:19 +01:00
|
|
|
public Vector3.Axis GetShortestAxisIndex()
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
2018-04-08 05:30:43 +02:00
|
|
|
var axis = Vector3.Axis.X;
|
2018-04-17 00:53:27 +02:00
|
|
|
real_t max_size = size.x;
|
2017-11-05 11:37:59 +01:00
|
|
|
|
|
|
|
if (size.y < max_size)
|
|
|
|
{
|
|
|
|
axis = Vector3.Axis.Y;
|
|
|
|
max_size = size.y;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (size.z < max_size)
|
|
|
|
{
|
|
|
|
axis = Vector3.Axis.Z;
|
|
|
|
}
|
|
|
|
|
|
|
|
return axis;
|
|
|
|
}
|
|
|
|
|
2018-03-01 08:51:35 +01:00
|
|
|
public real_t GetShortestAxisSize()
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
2018-04-17 00:53:27 +02:00
|
|
|
real_t max_size = size.x;
|
2017-11-05 11:37:59 +01:00
|
|
|
|
|
|
|
if (size.y < max_size)
|
|
|
|
max_size = size.y;
|
|
|
|
|
|
|
|
if (size.z < max_size)
|
|
|
|
max_size = size.z;
|
|
|
|
|
|
|
|
return max_size;
|
|
|
|
}
|
|
|
|
|
2017-11-21 23:32:19 +01:00
|
|
|
public Vector3 GetSupport(Vector3 dir)
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
|
|
|
Vector3 half_extents = size * 0.5f;
|
|
|
|
Vector3 ofs = position + half_extents;
|
|
|
|
|
|
|
|
return ofs + new Vector3(
|
2018-04-08 05:39:35 +02:00
|
|
|
dir.x > 0f ? -half_extents.x : half_extents.x,
|
|
|
|
dir.y > 0f ? -half_extents.y : half_extents.y,
|
|
|
|
dir.z > 0f ? -half_extents.z : half_extents.z);
|
2017-11-05 11:37:59 +01:00
|
|
|
}
|
|
|
|
|
2018-03-01 08:51:35 +01:00
|
|
|
public AABB Grow(real_t by)
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
2018-04-08 05:30:43 +02:00
|
|
|
var res = this;
|
2017-11-05 11:37:59 +01:00
|
|
|
|
|
|
|
res.position.x -= by;
|
|
|
|
res.position.y -= by;
|
|
|
|
res.position.z -= by;
|
|
|
|
res.size.x += 2.0f * by;
|
|
|
|
res.size.y += 2.0f * by;
|
|
|
|
res.size.z += 2.0f * by;
|
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
2017-11-21 23:32:19 +01:00
|
|
|
public bool HasNoArea()
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
|
|
|
return size.x <= 0f || size.y <= 0f || size.z <= 0f;
|
|
|
|
}
|
|
|
|
|
2017-11-21 23:32:19 +01:00
|
|
|
public bool HasNoSurface()
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
|
|
|
return size.x <= 0f && size.y <= 0f && size.z <= 0f;
|
|
|
|
}
|
|
|
|
|
2017-11-21 23:32:19 +01:00
|
|
|
public bool HasPoint(Vector3 point)
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
|
|
|
if (point.x < position.x)
|
|
|
|
return false;
|
|
|
|
if (point.y < position.y)
|
|
|
|
return false;
|
|
|
|
if (point.z < position.z)
|
|
|
|
return false;
|
|
|
|
if (point.x > position.x + size.x)
|
|
|
|
return false;
|
|
|
|
if (point.y > position.y + size.y)
|
|
|
|
return false;
|
|
|
|
if (point.z > position.z + size.z)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2017-11-21 23:32:19 +01:00
|
|
|
public AABB Intersection(AABB with)
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
|
|
|
Vector3 src_min = position;
|
|
|
|
Vector3 src_max = position + size;
|
|
|
|
Vector3 dst_min = with.position;
|
|
|
|
Vector3 dst_max = with.position + with.size;
|
|
|
|
|
|
|
|
Vector3 min, max;
|
|
|
|
|
|
|
|
if (src_min.x > dst_max.x || src_max.x < dst_min.x)
|
|
|
|
{
|
2017-11-17 03:09:00 +01:00
|
|
|
return new AABB();
|
2017-11-05 11:37:59 +01:00
|
|
|
}
|
2018-04-08 05:28:24 +02:00
|
|
|
|
2018-04-08 05:39:35 +02:00
|
|
|
min.x = src_min.x > dst_min.x ? src_min.x : dst_min.x;
|
|
|
|
max.x = src_max.x < dst_max.x ? src_max.x : dst_max.x;
|
2017-11-05 11:37:59 +01:00
|
|
|
|
|
|
|
if (src_min.y > dst_max.y || src_max.y < dst_min.y)
|
|
|
|
{
|
2017-11-17 03:09:00 +01:00
|
|
|
return new AABB();
|
2017-11-05 11:37:59 +01:00
|
|
|
}
|
2018-04-08 05:28:24 +02:00
|
|
|
|
2018-04-08 05:39:35 +02:00
|
|
|
min.y = src_min.y > dst_min.y ? src_min.y : dst_min.y;
|
|
|
|
max.y = src_max.y < dst_max.y ? src_max.y : dst_max.y;
|
2017-11-05 11:37:59 +01:00
|
|
|
|
|
|
|
if (src_min.z > dst_max.z || src_max.z < dst_min.z)
|
|
|
|
{
|
2017-11-17 03:09:00 +01:00
|
|
|
return new AABB();
|
2017-11-05 11:37:59 +01:00
|
|
|
}
|
2018-04-08 05:28:24 +02:00
|
|
|
|
2018-04-08 05:39:35 +02:00
|
|
|
min.z = src_min.z > dst_min.z ? src_min.z : dst_min.z;
|
|
|
|
max.z = src_max.z < dst_max.z ? src_max.z : dst_max.z;
|
2017-11-05 11:37:59 +01:00
|
|
|
|
2017-11-17 03:09:00 +01:00
|
|
|
return new AABB(min, max - min);
|
2017-11-05 11:37:59 +01:00
|
|
|
}
|
|
|
|
|
2017-11-21 23:32:19 +01:00
|
|
|
public bool Intersects(AABB with)
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
2018-04-08 05:39:35 +02:00
|
|
|
if (position.x >= with.position.x + with.size.x)
|
2017-11-05 11:37:59 +01:00
|
|
|
return false;
|
2018-04-08 05:39:35 +02:00
|
|
|
if (position.x + size.x <= with.position.x)
|
2017-11-05 11:37:59 +01:00
|
|
|
return false;
|
2018-04-08 05:39:35 +02:00
|
|
|
if (position.y >= with.position.y + with.size.y)
|
2017-11-05 11:37:59 +01:00
|
|
|
return false;
|
2018-04-08 05:39:35 +02:00
|
|
|
if (position.y + size.y <= with.position.y)
|
2017-11-05 11:37:59 +01:00
|
|
|
return false;
|
2018-04-08 05:39:35 +02:00
|
|
|
if (position.z >= with.position.z + with.size.z)
|
2017-11-05 11:37:59 +01:00
|
|
|
return false;
|
2018-04-08 05:39:35 +02:00
|
|
|
if (position.z + size.z <= with.position.z)
|
2017-11-05 11:37:59 +01:00
|
|
|
return false;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2017-11-21 23:32:19 +01:00
|
|
|
public bool IntersectsPlane(Plane plane)
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
|
|
|
Vector3[] points =
|
|
|
|
{
|
|
|
|
new Vector3(position.x, position.y, position.z),
|
|
|
|
new Vector3(position.x, position.y, position.z + size.z),
|
|
|
|
new Vector3(position.x, position.y + size.y, position.z),
|
|
|
|
new Vector3(position.x, position.y + size.y, position.z + size.z),
|
|
|
|
new Vector3(position.x + size.x, position.y, position.z),
|
|
|
|
new Vector3(position.x + size.x, position.y, position.z + size.z),
|
|
|
|
new Vector3(position.x + size.x, position.y + size.y, position.z),
|
2018-04-08 05:28:24 +02:00
|
|
|
new Vector3(position.x + size.x, position.y + size.y, position.z + size.z)
|
2017-11-05 11:37:59 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
bool over = false;
|
|
|
|
bool under = false;
|
|
|
|
|
2018-04-17 00:33:42 +02:00
|
|
|
for (int i = 0; i < 8; i++)
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
2017-11-21 23:32:19 +01:00
|
|
|
if (plane.DistanceTo(points[i]) > 0)
|
2017-11-05 11:37:59 +01:00
|
|
|
over = true;
|
|
|
|
else
|
|
|
|
under = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return under && over;
|
|
|
|
}
|
|
|
|
|
2017-11-21 23:32:19 +01:00
|
|
|
public bool IntersectsSegment(Vector3 from, Vector3 to)
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
2018-03-01 08:51:35 +01:00
|
|
|
real_t min = 0f;
|
|
|
|
real_t max = 1f;
|
2017-11-05 11:37:59 +01:00
|
|
|
|
2018-04-17 00:33:42 +02:00
|
|
|
for (int i = 0; i < 3; i++)
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
2018-03-01 08:51:35 +01:00
|
|
|
real_t seg_from = from[i];
|
|
|
|
real_t seg_to = to[i];
|
|
|
|
real_t box_begin = position[i];
|
|
|
|
real_t box_end = box_begin + size[i];
|
|
|
|
real_t cmin, cmax;
|
2017-11-05 11:37:59 +01:00
|
|
|
|
|
|
|
if (seg_from < seg_to)
|
|
|
|
{
|
|
|
|
if (seg_from > box_end || seg_to < box_begin)
|
|
|
|
return false;
|
|
|
|
|
2018-03-01 08:51:35 +01:00
|
|
|
real_t length = seg_to - seg_from;
|
2017-11-05 11:37:59 +01:00
|
|
|
cmin = seg_from < box_begin ? (box_begin - seg_from) / length : 0f;
|
|
|
|
cmax = seg_to > box_end ? (box_end - seg_from) / length : 1f;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (seg_to > box_end || seg_from < box_begin)
|
|
|
|
return false;
|
|
|
|
|
2018-03-01 08:51:35 +01:00
|
|
|
real_t length = seg_to - seg_from;
|
2017-11-05 11:37:59 +01:00
|
|
|
cmin = seg_from > box_end ? (box_end - seg_from) / length : 0f;
|
|
|
|
cmax = seg_to < box_begin ? (box_begin - seg_from) / length : 1f;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cmin > min)
|
|
|
|
{
|
|
|
|
min = cmin;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cmax < max)
|
|
|
|
max = cmax;
|
|
|
|
if (max < min)
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2017-11-21 23:32:19 +01:00
|
|
|
public AABB Merge(AABB with)
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
|
|
|
Vector3 beg_1 = position;
|
|
|
|
Vector3 beg_2 = with.position;
|
2018-04-17 00:53:27 +02:00
|
|
|
var end_1 = new Vector3(size.x, size.y, size.z) + beg_1;
|
|
|
|
var end_2 = new Vector3(with.size.x, with.size.y, with.size.z) + beg_2;
|
2017-11-05 11:37:59 +01:00
|
|
|
|
2018-04-08 05:30:43 +02:00
|
|
|
var min = new Vector3(
|
2018-04-08 05:39:35 +02:00
|
|
|
beg_1.x < beg_2.x ? beg_1.x : beg_2.x,
|
|
|
|
beg_1.y < beg_2.y ? beg_1.y : beg_2.y,
|
|
|
|
beg_1.z < beg_2.z ? beg_1.z : beg_2.z
|
2017-11-05 11:37:59 +01:00
|
|
|
);
|
|
|
|
|
2018-04-08 05:30:43 +02:00
|
|
|
var max = new Vector3(
|
2018-04-08 05:39:35 +02:00
|
|
|
end_1.x > end_2.x ? end_1.x : end_2.x,
|
|
|
|
end_1.y > end_2.y ? end_1.y : end_2.y,
|
|
|
|
end_1.z > end_2.z ? end_1.z : end_2.z
|
2017-11-05 11:37:59 +01:00
|
|
|
);
|
|
|
|
|
2017-11-17 03:09:00 +01:00
|
|
|
return new AABB(min, max - min);
|
2017-11-05 11:37:59 +01:00
|
|
|
}
|
2018-03-01 08:51:35 +01:00
|
|
|
|
|
|
|
// Constructors
|
2017-11-17 03:09:00 +01:00
|
|
|
public AABB(Vector3 position, Vector3 size)
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
|
|
|
this.position = position;
|
|
|
|
this.size = size;
|
|
|
|
}
|
|
|
|
|
2017-11-17 03:09:00 +01:00
|
|
|
public static bool operator ==(AABB left, AABB right)
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
|
|
|
return left.Equals(right);
|
|
|
|
}
|
|
|
|
|
2017-11-17 03:09:00 +01:00
|
|
|
public static bool operator !=(AABB left, AABB right)
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
|
|
|
return !left.Equals(right);
|
|
|
|
}
|
|
|
|
|
|
|
|
public override bool Equals(object obj)
|
|
|
|
{
|
2017-11-17 03:09:00 +01:00
|
|
|
if (obj is AABB)
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
2017-11-17 03:09:00 +01:00
|
|
|
return Equals((AABB)obj);
|
2017-11-05 11:37:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-11-17 03:09:00 +01:00
|
|
|
public bool Equals(AABB other)
|
2017-11-05 11:37:59 +01:00
|
|
|
{
|
|
|
|
return position == other.position && size == other.size;
|
|
|
|
}
|
|
|
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
{
|
|
|
|
return position.GetHashCode() ^ size.GetHashCode();
|
|
|
|
}
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
{
|
|
|
|
return String.Format("{0} - {1}", new object[]
|
|
|
|
{
|
2018-04-08 05:28:24 +02:00
|
|
|
position.ToString(),
|
|
|
|
size.ToString()
|
2017-11-05 11:37:59 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
public string ToString(string format)
|
|
|
|
{
|
|
|
|
return String.Format("{0} - {1}", new object[]
|
|
|
|
{
|
2018-04-08 05:28:24 +02:00
|
|
|
position.ToString(format),
|
|
|
|
size.ToString(format)
|
2017-11-05 11:37:59 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|