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 | Public Attributes | Properties
VisiMath.Geometry.OOBox Class Reference

Object oriented box. More...

Inheritance diagram for VisiMath.Geometry.OOBox:

List of all members.

## Public Member Functions
| OOBox ()
| Default constructor.
| OOBox (System.Xml.XmlReader reader)
| XML reader constructor.
void | ClosestPoint (ref Vector3 point, out Vector3 target)
| Calculates closest point on the box to position.
Vector3 | ClosestPoint (ref Vector3 point)
| Calculates closest point on the box to position.
Vector3 | ClosestPointLine (ref Vector3 l1, ref Vector3 l2)
| Calculates closest point on the box to line.
float | SquaredDistance (ref Vector3 point)
| Calculates squared distance between vector and object.
override float | Distance (ref Vector3 point)
| Calculates distance between vector and object.
bool | Intersects (OOBox another)
| Quick intersection test of two object oriented boxes Uses separating axes theorem.
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 float | IntersectsMoving (float radius, Ray ray, float maxdistance)
| Checks for intersection between object and moving sphere.
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.
override float | DistanceTriangle (ref Vector3 pos1, ref Vector3 pos2, ref Vector3 pos3)
| Returns closest distance to the triangle.
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.
Vector3[] | GetCorners ()
| Returns vertices of the object.
Vector3[] | GetQuads ()
override Point3DList | ToPoints (Type vertextype, float quality=0, int vertexlimit=0)
| Convert object to list of points.
QuadList | ToQuadList (Type VertexType, float quality=0, int vertexlimit=0)
override LineList | ToLines (Type vertextype, float quality=0, int vertexlimit=0)
| Convert object to list of lines.
override TriangleList | ToTriangles (Type vertextype, float quality=0, int vertexlimit=0)
| Convert object to list of triangles. Valid only for surface based objects, otherwise returns null.
override IndexedMesh | ToIndexedMesh (Type vertextype, float quality=0, int vertexlimit=0)
| Convert object to indexed triangle mesh. Valid only for surface based objects, otherwise returns null.
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.
## Public Attributes
Vector3 | _Center
| Center of the box.
Vector3[] | Axes = new Vector3[3]
| Rotation of box expressed in three orientation normals.
Vector3 | HalfSize
| Halfsizes of the box.
## Properties
override bool | IsPrimitive`[get]`
| OOBox is not renderable primitive.
override Vector3 | Center`[get]`
| Center of the box.
override bool | IsContainer`[get]`
| No, it's not container.
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.
override PrimitiveTypes | PreferredPrimitive`[get]`
| Preferred primitive type for rendering.
override Type | PreferredVertexType`[get]`
| Preferred vertex type for default conversion.

## Detailed Description

Object oriented box.

## Constructor & Destructor Documentation

VisiMath.Geometry.OOBox.OOBox | ( |  | ) |

Default constructor.

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

XML reader constructor.

Parameters:

  reader | XML reader

## Member Function Documentation

void VisiMath.Geometry.OOBox.ClosestPoint | ( | ref Vector3 | point,
|  | out Vector3 | target
| ) |  |

Calculates closest point on the box to position.

Parameters:

  point | Position
  target | Vector to save closest point on the box

Vector3 VisiMath.Geometry.OOBox.ClosestPoint | ( | ref Vector3 | point | ) |

Calculates closest point on the box to position.

Parameters:

  point | Position

Returns:
  Vector to save closest point on the box

Vector3 VisiMath.Geometry.OOBox.ClosestPointLine | ( | ref Vector3 | l1,
|  | ref Vector3 | l2
| ) |  |

Calculates closest point on the box to line.

Parameters:

  l1 | Line start
  l2 | Line end

Returns:
  Closest point on the box

override bool VisiMath.Geometry.OOBox.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.OOBox.Distance | ( | ref Vector3 | point | ) | `[virtual]`

Calculates distance between vector and object.

Parameters:

  point | Positional vector

Returns:
  Distance

Reimplemented from VisiMath.Geometry.BaseGeometry.

override float VisiMath.Geometry.OOBox.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.OOBox.DistanceLineSegment | ( | ref Vector3 | pos1,
|  | ref Vector3 | pos2
| ) |  | `[virtual]`

Returns closest distance to the line segment.

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.OOBox.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.OOBox.GetCopy | ( |  | ) | `[virtual]`

Returns copy of the geometric data.

Returns:
  Full copy of the geometry

Implements VisiMath.Geometry.BaseGeometry.

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

Returns vertices of the object.

Returns:
  Corners of the box

override bool VisiMath.Geometry.OOBox.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.OOBox.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.OOBox.GetQuads | ( |  | ) |

void VisiMath.Geometry.OOBox.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.

bool VisiMath.Geometry.OOBox.Intersects | ( | OOBox | another | ) |

Quick intersection test of two object oriented boxes Uses separating axes theorem.

Parameters:

  another |

Returns:

override float VisiMath.Geometry.OOBox.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.OOBox.ReadXml | ( | System.Xml.XmlReader | reader | ) | `[virtual]`

Deserializes object from XML.

Parameters:

  reader | XML reader

Implements VisiMath.Geometry.BaseGeometry.

float VisiMath.Geometry.OOBox.SquaredDistance | ( | ref Vector3 | point | ) |

Calculates squared distance between vector and object.

Parameters:

  point | Positional vector

Returns:
  Distance

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

Convert object to indexed triangle mesh. Valid only for surface based objects, otherwise returns null.

Returns:
  New geometry object containing triangle faces of the object surface

Parameters:

  quality | unused
  vertexlimit | unused.
  vertextype | Required type of the vertex

Implements VisiMath.Geometry.BaseGeometry.

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

Convert object to list of lines.

Returns:
  New geometry object containing edges of the object

Parameters:

  quality | unused
  vertexlimit | unused.
  vertextype | Required type of the vertex

Implements VisiMath.Geometry.BaseGeometry.

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

Convert object to list of points.

Returns:
  New geometry object containing point based definition of the object

Parameters:

  quality | Unused
  vertexlimit | Unused.
  vertextype | Required type of the vertex

Implements VisiMath.Geometry.BaseGeometry.

QuadList VisiMath.Geometry.OOBox.ToQuadList | ( | Type | VertexType,
|  | float | quality = `0`,
|  | int | vertexlimit = `0`
| ) |  |

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

Convert object to list of triangles. Valid only for surface based objects, otherwise returns null.

Returns:
  New geometry object containing triangle faces of the object surface.

Parameters:

  quality | unused
  vertexlimit | unused.
  vertextype | Required type of the vertex

Implements VisiMath.Geometry.BaseGeometry.

override void VisiMath.Geometry.OOBox.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.OOBox._Center

Center of the box.

Vector3 [] VisiMath.Geometry.OOBox.Axes = new Vector3[3]

Rotation of box expressed in three orientation normals.

Vector3 VisiMath.Geometry.OOBox.HalfSize

Halfsizes of the box.

## Property Documentation

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

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

Implements VisiMath.Geometry.IConvexObject.

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

Center of the box.

Reimplemented from VisiMath.Geometry.BaseGeometry.

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

No, it's not container.

Reimplemented from VisiMath.Geometry.BaseGeometry.

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

OOBox is not renderable primitive.

Reimplemented from VisiMath.Geometry.BaseGeometry.

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

Preferred primitive type for rendering.

Reimplemented from VisiMath.Geometry.BaseGeometry.

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

Preferred vertex type for default conversion.

Reimplemented from VisiMath.Geometry.BaseGeometry.

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

Returns number of vertices, valid for explicit object types.

Implements VisiMath.Geometry.IConvexObject.

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

- OOBox.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events