VisimBox 1.0 VisimBox 3d simulation and visualisation ToolBox

- Main Page
- Packages
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Public Attributes | Properties
VisiMath.Geometry.AABox Class Reference

Axis alligned box. More...

Inheritance diagram for VisiMath.Geometry.AABox:

List of all members.

## Public Member Functions
| AABox ()
| Default constructor, expects user to set minimum and maximum to correct values.
| AABox (System.Xml.XmlReader reader)
| XML reader constructor.
| AABox (Vector3 min, Vector3 max)
| Constructs aabox from minimal and maximal corner.
| AABox (ref Vector3 min, ref Vector3 max)
| Constructs aabox from minimal and maximal corner.
| AABox (float x, float y, float z)
override bool | ContainsPosition (Vector3 pos)
| Checks if specified position is inside the object.
override bool | GetIntersectionInfo (Ray obj, ref IIntersectionInfo inters)
| Check for intersection and fills intersection info if intersection is closer to the origin of the ray then value before.
override Point3DList | ToPoints (Type vertextype, float quality=0, int vertexlimit=0)
| Convert object to list of points. Quality and vertex limits not used.
override float | Distance (ref Vector3 pos)
| Returns closest distance from the specified point to object.
override float | Distance (Ray ray, bool frontOnly=false)
| Returns closest distance to the ray.
override float | DistanceLineSegment (ref Vector3 pos1, ref Vector3 pos2)
| Returns closest distance to the line segment. Generic, from center, OVERRIDE!
override float | DistanceTriangle (ref Vector3 pos1, ref Vector3 pos2, ref Vector3 pos3)
| Returns closest distance to the triangle.
override float | DistanceSphere (ref Vector3 center, float radius)
| Returns closest distance to the sphere.
override float | IntersectsMoving (float radius, Ray ray, float maxdistance)
| Checks for intersection between object and moving sphere.
Vector3[] | GetCorners ()
Vector3[] | GetQuads ()
QuadList | ToQuadList< VertexT > ()
virtual QuadList | ToQuadList (Type VertexType)
override LineList | ToLines (Type vertextype, float quality=0, int vertexlimit=0)
| Convert object to list of lines. Quality and vertex limits not used.
override TriangleList | ToTriangles (Type vertextype, float quality=0, int vertexlimit=0)
| Convert object to list of triangles. Quality and vertex limits not used.
override IndexedMesh | ToIndexedMesh (Type vertextype, float quality=0, int vertexlimit=0)
| Convert object to indexed list of triangles. Quality and vertex limits not used.
void | GetLocalSupportingVertex (ref Vector3 direction, out Vector3 vertex)
| Gets supporting vertex in local coordinates.
void | GetVertex (int index, out Vector3 vertex)
| Returns vertex with specified index, valid for explicit object types.
bool | Contains (ref ISpatialIndex index)
| return true if index contains (intersects) another index
bool | Contains (Vector3 index)
| Return true if index contains position.
bool | Contains (ref Vector3 index)
| Return true if index contains position.
bool | Contains (Point3D index)
| Return true if index contains position.
bool | ContainsLine (Vector3 line1, Vector3 line2)
| Return true if index contains line.
bool | ContainsLine (ref Vector3 line1, ref Vector3 line2)
| Return true if index contains line.
bool | Contains (LineSegment3D line)
| Return true if index contains line.
bool | Contains (Vector3 center, float radius)
| Return true if index contains sphere.
bool | Contains (ref Vector3 center, float radius)
| Return true if index contains sphere.
bool | Contains (Sphere sphere)
| Return true if index contains sphere.
bool | ContainsBox (Vector3 min, Vector3 max)
| Return true if index contains axis alligned box.
bool | ContainsBox (ref Vector3 min, ref Vector3 max)
| Return true if index contains axis alligned box.
bool | Contains (AABox box)
| Return true if index contains axis alligned box.
bool | Contains (IConvexObject convex)
| Return true if index contains generic convex object.
bool | ContainsFully (ref ISpatialIndex index)
| return true if index fully contains another index
bool | ContainsFullyLine (Vector3 line1, Vector3 line2)
| Return true if index fully contains line.
bool | ContainsFullyLine (ref Vector3 line1, ref Vector3 line2)
| Return true if index fully contains line.
bool | ContainsFully (LineSegment3D line)
| Return true if index fully contains line.
bool | ContainsFully (Vector3 center, float radius)
| Return true if index fully contains sphere.
bool | ContainsFully (ref Vector3 center, float radius)
| Return true if index fully contains sphere.
bool | ContainsFully (Sphere sphere)
| Return true if index fully contains sphere.
bool | ContainsFullyBox (Vector3 min, Vector3 max)
| Return true if index fully contains axis alligned box.
bool | ContainsFullyBox (ref Vector3 min, ref Vector3 max)
| Return true if index fully contains axis alligned box.
bool | ContainsFully (AABox box)
| Return true if index fully contains axis alligned box.
bool | ContainsFully (IConvexObject convex)
| Return true if index FULLY contains generic convex object.
override void | ReadXml (System.Xml.XmlReader reader)
| Deserializes object from XML.
override void | WriteXml (System.Xml.XmlWriter writer)
| Serializes object to XML.
override IGeometry | GetCopy ()
| Returns copy of the geometric data.
## Static Public Member Functions
static AABox | ConstructFromPositions (ICollection< Vector3 > vertices)
| Constructs new aabox for array of vertices.
## Public Attributes
Vector3 | Minimum
| Minimal values for the corner.
Vector3 | Maximum
| Maximal values for the opposite corner.
## Properties
Vector3 | HalfExtents`[get]`
| Returns halfextents from the center of the box.
override Vector3 | Center`[get]`
| Center of the object.
override Type | PreferredVertexType`[get]`
| Prefers textured vertex.
override bool | IsPrimitive`[get]`
| Is object geometric renderable primitive from enumaration PrimitiveTypes?
override bool | IsContainer`[get]`
| Parametric box is not a container.
override PrimitiveTypes | PreferredPrimitive`[get]`
| Preferred primitive is triangle list.
float | Volume`[get]`
| Volume of the object.
ConvexObjectType | BaseType`[get]`
| Returns implicit (math expression) or explicit (vertex based) type of convex object.
int | VertexCount`[get]`
| Returns number of vertices, valid for explicit object types.
AABox | AsBox`[get]`
| Returns spatial index as box.
Sphere | AsSphere`[get]`
| Returns spatial index as sphere.
Vector3 | AsPoint`[get]`
| returns spatial index as point (center)

## Detailed Description

Axis alligned box.

## Constructor & Destructor Documentation

VisiMath.Geometry.AABox.AABox | ( |  | ) |

Default constructor, expects user to set minimum and maximum to correct values.

VisiMath.Geometry.AABox.AABox | ( | System.Xml.XmlReader | reader | ) |

XML reader constructor.

Parameters:

  reader | XML reader

VisiMath.Geometry.AABox.AABox | ( | Vector3 | min,
|  | Vector3 | max
| ) |  |

Constructs aabox from minimal and maximal corner.

Parameters:

  min | minimal corner
  max | maximal corner

VisiMath.Geometry.AABox.AABox | ( | ref Vector3 | min,
|  | ref Vector3 | max
| ) |  |

Constructs aabox from minimal and maximal corner.

Parameters:

  min | minimal corner
  max | maximal corner

VisiMath.Geometry.AABox.AABox | ( | float | x,
|  | float | y,
|  | float | z
| ) |  |

## Member Function Documentation

static AABox VisiMath.Geometry.AABox.ConstructFromPositions | ( | ICollection< Vector3 > | vertices | ) | `[static]`

Constructs new aabox for array of vertices.

Parameters:

  vertices |

Returns:

bool VisiMath.Geometry.AABox.Contains | ( | ref ISpatialIndex | index | ) |

return true if index contains (intersects) another index

Parameters:

  index | Second spatial index

Returns:
  True if intersection exists

Implements VisiMath.Collisions.ISpatialIndex.

bool VisiMath.Geometry.AABox.Contains | ( | IConvexObject | convex | ) |

Return true if index contains generic convex object.

Parameters:

  convex | Convex object

Returns:
  True if intersection exists

Implements VisiMath.Collisions.ISpatialIndex.

bool VisiMath.Geometry.AABox.Contains | ( | Vector3 | index | ) |

Return true if index contains position.

Parameters:

  index | Position index

Returns:
  True if intersection exists

Implements VisiMath.Collisions.ISpatialIndex.

bool VisiMath.Geometry.AABox.Contains | ( | ref Vector3 | index | ) |

Return true if index contains position.

Parameters:

  index | Position index

Returns:
  True if intersection exists

Implements VisiMath.Collisions.ISpatialIndex.

bool VisiMath.Geometry.AABox.Contains | ( | Point3D | index | ) |

Return true if index contains position.

Parameters:

  index | Position index

Returns:
  True if intersection exists

Implements VisiMath.Collisions.ISpatialIndex.

bool VisiMath.Geometry.AABox.Contains | ( | LineSegment3D | line | ) |

Return true if index contains line.

Parameters:

  index | line index

Returns:
  True if intersection exists

Implements VisiMath.Collisions.ISpatialIndex.

bool VisiMath.Geometry.AABox.Contains | ( | Vector3 | center,
|  | float | radius
| ) |  |

Return true if index contains sphere.

Parameters:

  center | sphere center
  radius | sphere radius

Returns:
  True if intersection exists

Implements VisiMath.Collisions.ISpatialIndex.

bool VisiMath.Geometry.AABox.Contains | ( | ref Vector3 | center,
|  | float | radius
| ) |  |

Return true if index contains sphere.

Parameters:

  center | sphere center
  radius | sphere radius

Returns:
  True if intersection exists

Implements VisiMath.Collisions.ISpatialIndex.

bool VisiMath.Geometry.AABox.Contains | ( | Sphere | sphere | ) |

Return true if index contains sphere.

Parameters:

  sphere | sphere index

Returns:
  True if intersection exists

Implements VisiMath.Collisions.ISpatialIndex.

bool VisiMath.Geometry.AABox.Contains | ( | AABox | box | ) |

Return true if index contains axis alligned box.

Parameters:

  box | AABox

Returns:
  True if intersection exists

Implements VisiMath.Collisions.ISpatialIndex.

bool VisiMath.Geometry.AABox.ContainsBox | ( | Vector3 | min,
|  | Vector3 | max
| ) |  |

Return true if index contains axis alligned box.

Parameters:

  max | Maximal corner
  min | Minimal corner

Returns:
  True if intersection exists

Implements VisiMath.Collisions.ISpatialIndex.

bool VisiMath.Geometry.AABox.ContainsBox | ( | ref Vector3 | min,
|  | ref Vector3 | max
| ) |  |

Return true if index contains axis alligned box.

Parameters:

  max | Maximal corner
  min | Minimal corner

Returns:
  True if intersection exists

Implements VisiMath.Collisions.ISpatialIndex.

bool VisiMath.Geometry.AABox.ContainsFully | ( | ref ISpatialIndex | index | ) |

return true if index fully contains another index

Parameters:

  index | Second spatial index

Returns:
  True if index fully contains other object

Implements VisiMath.Collisions.ISpatialIndex.

bool VisiMath.Geometry.AABox.ContainsFully | ( | LineSegment3D | line | ) |

Return true if index fully contains line.

Parameters:

  line | Line segment

Returns:
  True if index fully contains other object

Implements VisiMath.Collisions.ISpatialIndex.

bool VisiMath.Geometry.AABox.ContainsFully | ( | Vector3 | center,
|  | float | radius
| ) |  |

Return true if index fully contains sphere.

Parameters:

  center | sphere center
  radius | sphere radius

Returns:
  True if index fully contains other object

Implements VisiMath.Collisions.ISpatialIndex.

bool VisiMath.Geometry.AABox.ContainsFully | ( | ref Vector3 | center,
|  | float | radius
| ) |  |

Return true if index fully contains sphere.

Parameters:

  center | sphere center
  radius | sphere radius

Returns:
  True if index fully contains other object

Implements VisiMath.Collisions.ISpatialIndex.

bool VisiMath.Geometry.AABox.ContainsFully | ( | AABox | box | ) |

Return true if index fully contains axis alligned box.

Parameters:

  box | AABox

Returns:
  True if index fully contains other object

Implements VisiMath.Collisions.ISpatialIndex.

bool VisiMath.Geometry.AABox.ContainsFully | ( | IConvexObject | convex | ) |

Return true if index FULLY contains generic convex object.

Parameters:

  convex | Convex object

Returns:
  True if object is fully contained in index

Implements VisiMath.Collisions.ISpatialIndex.

bool VisiMath.Geometry.AABox.ContainsFully | ( | Sphere | sphere | ) |

Return true if index fully contains sphere.

Parameters:

  sphere | sphere index

Returns:
  True if index fully contains other object

Implements VisiMath.Collisions.ISpatialIndex.

bool VisiMath.Geometry.AABox.ContainsFullyBox | ( | ref Vector3 | min,
|  | ref Vector3 | max
| ) |  |

Return true if index fully contains axis alligned box.

Parameters:

  max | Maximal corner
  min | Minimal corner

Returns:
  True if index fully contains other object

Implements VisiMath.Collisions.ISpatialIndex.

bool VisiMath.Geometry.AABox.ContainsFullyBox | ( | Vector3 | min,
|  | Vector3 | max
| ) |  |

Return true if index fully contains axis alligned box.

Parameters:

  max | Maximal corner
  min | Minimal corner

Returns:
  True if index fully contains other object

Implements VisiMath.Collisions.ISpatialIndex.

bool VisiMath.Geometry.AABox.ContainsFullyLine | ( | Vector3 | line1,
|  | Vector3 | line2
| ) |  |

Return true if index fully contains line.

Parameters:

  line1 | Start of the line
  line2 | End of the line

Returns:
  True if index fully contains other object

Implements VisiMath.Collisions.ISpatialIndex.

bool VisiMath.Geometry.AABox.ContainsFullyLine | ( | ref Vector3 | line1,
|  | ref Vector3 | line2
| ) |  |

Return true if index fully contains line.

Parameters:

  line1 | Start of the line
  line2 | End of the line

Returns:
  True if index fully contains other object

Implements VisiMath.Collisions.ISpatialIndex.

bool VisiMath.Geometry.AABox.ContainsLine | ( | Vector3 | line1,
|  | Vector3 | line2
| ) |  |

Return true if index contains line.

Parameters:

  line1 | Start of the line
  line2 | End of the line

Returns:
  True if intersection exists

Implements VisiMath.Collisions.ISpatialIndex.

bool VisiMath.Geometry.AABox.ContainsLine | ( | ref Vector3 | line1,
|  | ref Vector3 | line2
| ) |  |

Return true if index contains line.

Parameters:

  line1 | Start of the line
  line2 | End of the line

Returns:
  True if intersection exists

Implements VisiMath.Collisions.ISpatialIndex.

override bool VisiMath.Geometry.AABox.ContainsPosition | ( | Vector3 | pos | ) | `[virtual]`

Checks if specified position is inside the object.

Parameters:

  pos | Position to check

Returns:
  True if vector is inside the object

Implements VisiMath.Geometry.BaseGeometry.

override float VisiMath.Geometry.AABox.Distance | ( | ref Vector3 | pos | ) | `[virtual]`

Returns closest distance from the specified point to object.

Parameters:

  pos | position

Returns:
  Closest distance to the object

Reimplemented from VisiMath.Geometry.BaseGeometry.

override float VisiMath.Geometry.AABox.Distance | ( | Ray | ray,
|  | bool | frontOnly = `false`
| ) |  | `[virtual]`

Returns closest distance to the ray.

Parameters:

  ray | Ray to check distance to
  frontOnly | Check only objects in front of the origin

Returns:
  Closest distance to the ray, if frontOnly and object is behind the ray, returns NaN

Reimplemented from VisiMath.Geometry.BaseGeometry.

override float VisiMath.Geometry.AABox.DistanceLineSegment | ( | ref Vector3 | pos1,
|  | ref Vector3 | pos2
| ) |  | `[virtual]`

Returns closest distance to the line segment. Generic, from center, OVERRIDE!

param name="pos1">Start of the line

param name="pos2">end of the line

Returns:
  Closest distance

Reimplemented from VisiMath.Geometry.BaseGeometry.

override float VisiMath.Geometry.AABox.DistanceSphere | ( | ref Vector3 | center,
|  | float | radius
| ) |  | `[virtual]`

Returns closest distance to the sphere.

Parameters:

  center | center of the sphere
  radius | radius of the sphere

Returns:
  Closest distance

Reimplemented from VisiMath.Geometry.BaseGeometry.

override float VisiMath.Geometry.AABox.DistanceTriangle | ( | ref Vector3 | pos1,
|  | ref Vector3 | pos2,
|  | ref Vector3 | pos3
| ) |  | `[virtual]`

Returns closest distance to the triangle.

Parameters:

  pos1 | First corner
  pos2 | Second corner
  pos3 | Third corner

Returns:
  Distance

Reimplemented from VisiMath.Geometry.BaseGeometry.

override IGeometry VisiMath.Geometry.AABox.GetCopy | ( |  | ) | `[virtual]`

Returns copy of the geometric data.

Returns:
  Full copy of the geometry

Implements VisiMath.Geometry.BaseGeometry.

Vector3 [] VisiMath.Geometry.AABox.GetCorners | ( |  | ) |

override bool VisiMath.Geometry.AABox.GetIntersectionInfo | ( | Ray | obj,
|  | ref IIntersectionInfo | inters
| ) |  | `[virtual]`

Check for intersection and fills intersection info if intersection is closer to the origin of the ray then value before.

Parameters:

  inters | Data structure with intersection info
  obj | Ray object

Returns:
  True if there was an intersection and it was closer then previous stored

Implements VisiMath.Geometry.BaseGeometry.

void VisiMath.Geometry.AABox.GetLocalSupportingVertex | ( | ref Vector3 | direction,
|  | out Vector3 | vertex
| ) |  |

Gets supporting vertex in local coordinates.

Parameters:

  vertex | Save vertex
  direction | Direction vector

Implements VisiMath.Geometry.IConvexObject.

Vector3 [] VisiMath.Geometry.AABox.GetQuads | ( |  | ) |

void VisiMath.Geometry.AABox.GetVertex | ( | int | index,
|  | out Vector3 | vertex
| ) |  |

Returns vertex with specified index, valid for explicit object types.

Parameters:

  index | index of vertex
  vertex | Vector to save vertex

Implements VisiMath.Geometry.IConvexObject.

override float VisiMath.Geometry.AABox.IntersectsMoving | ( | float | radius,
|  | Ray | ray,
|  | float | maxdistance
| ) |  | `[virtual]`

Checks for intersection between object and moving sphere.

param name="radius">Radius of the sphere

Parameters:

  maxdistance | Maximal distance to travel
  ray | Ray describing movement of the sphere

Returns:
  Distance to the intersection or -1 if no intersection exists

Implements VisiMath.Geometry.BaseGeometry.

override void VisiMath.Geometry.AABox.ReadXml | ( | System.Xml.XmlReader | reader | ) | `[virtual]`

Deserializes object from XML.

Parameters:

  reader | XML reader

Implements VisiMath.Geometry.BaseGeometry.

override IndexedMesh VisiMath.Geometry.AABox.ToIndexedMesh | ( | Type | vertextype,
|  | float | quality = `0`,
|  | int | vertexlimit = `0`
| ) |  | `[virtual]`

Convert object to indexed list of triangles. Quality and vertex limits not used.

Implements VisiMath.Geometry.BaseGeometry.

override LineList VisiMath.Geometry.AABox.ToLines | ( | Type | vertextype,
|  | float | quality = `0`,
|  | int | vertexlimit = `0`
| ) |  | `[virtual]`

Convert object to list of lines. Quality and vertex limits not used.

Implements VisiMath.Geometry.BaseGeometry.

override Point3DList VisiMath.Geometry.AABox.ToPoints | ( | Type | vertextype,
|  | float | quality = `0`,
|  | int | vertexlimit = `0`
| ) |  | `[virtual]`

Convert object to list of points. Quality and vertex limits not used.

Parameters:

  vertextype | Required type of the vertex

Implements VisiMath.Geometry.BaseGeometry.

virtual QuadList VisiMath.Geometry.AABox.ToQuadList | ( | Type | VertexType | ) | `[virtual]`

QuadList VisiMath.Geometry.AABox.ToQuadList< VertexT > | ( |  | ) |

Type Constraints

  VertexT | : | IVertex |

override TriangleList VisiMath.Geometry.AABox.ToTriangles | ( | Type | vertextype,
|  | float | quality = `0`,
|  | int | vertexlimit = `0`
| ) |  | `[virtual]`

Convert object to list of triangles. Quality and vertex limits not used.

Implements VisiMath.Geometry.BaseGeometry.

override void VisiMath.Geometry.AABox.WriteXml | ( | System.Xml.XmlWriter | writer | ) | `[virtual]`

Serializes object to XML.

Parameters:

  writer | XML writer to save values

Implements VisiMath.Geometry.BaseGeometry.

## Member Data Documentation

Vector3 VisiMath.Geometry.AABox.Maximum

Maximal values for the opposite corner.

Vector3 VisiMath.Geometry.AABox.Minimum

Minimal values for the corner.

## Property Documentation

AABox VisiMath.Geometry.AABox.AsBox`[get]`

Returns spatial index as box.

Implements VisiMath.Collisions.ISpatialIndex.

Vector3 VisiMath.Geometry.AABox.AsPoint`[get]`

returns spatial index as point (center)

Implements VisiMath.Collisions.ISpatialIndex.

Sphere VisiMath.Geometry.AABox.AsSphere`[get]`

Returns spatial index as sphere.

Implements VisiMath.Collisions.ISpatialIndex.

ConvexObjectType VisiMath.Geometry.AABox.BaseType`[get]`

Returns implicit (math expression) or explicit (vertex based) type of convex object.

Implements VisiMath.Geometry.IConvexObject.

override Vector3 VisiMath.Geometry.AABox.Center`[get]`

Center of the object.

Reimplemented from VisiMath.Geometry.BaseGeometry.

Vector3 VisiMath.Geometry.AABox.HalfExtents`[get]`

Returns halfextents from the center of the box.

override bool VisiMath.Geometry.AABox.IsContainer`[get]`

Parametric box is not a container.

Reimplemented from VisiMath.Geometry.BaseGeometry.

override bool VisiMath.Geometry.AABox.IsPrimitive`[get]`

Is object geometric renderable primitive from enumaration PrimitiveTypes?

Reimplemented from VisiMath.Geometry.BaseGeometry.

override PrimitiveTypes VisiMath.Geometry.AABox.PreferredPrimitive`[get]`

Preferred primitive is triangle list.

Reimplemented from VisiMath.Geometry.BaseGeometry.

override Type VisiMath.Geometry.AABox.PreferredVertexType`[get]`

Prefers textured vertex.

Reimplemented from VisiMath.Geometry.BaseGeometry.

int VisiMath.Geometry.AABox.VertexCount`[get]`

Returns number of vertices, valid for explicit object types.

Implements VisiMath.Geometry.IConvexObject.

float VisiMath.Geometry.AABox.Volume`[get]`

Volume of the object.

Implements VisiMath.Geometry.IVolumetric.

The documentation for this class was generated from the following file:

- AABox.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events