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 | Properties
VisiMath.Geometry.Quad Class Reference

Simple 3d quad (two triangles) More...

Inheritance diagram for VisiMath.Geometry.Quad:

List of all members.

## Public Member Functions
override IGeometry | GetCopy ()
| Returns copy of the geometric data.
| Quad (System.Xml.XmlReader reader)
| XML reader constructor.
| Quad ()
| Constructs quad with standard vertex format (no values set)
| Quad (Type vertextype)
| Constructs quad of specified vertex type.
| Quad (IVertex first, IVertex second, IVertex third, IVertex fourth)
| Constructs quad from three vertices. Note, all vertices should be of same format!
| Quad (Vector3 first, Vector3 second, Vector3 third, Vector3 fourth)
| Constructs quad from three position vectors.
| Quad (IVertexArray vert)
| Constructs quad from the vertex array.
| Quad (IVertexArray vert, int startingindex)
| Constructs quad from specified vertices in array.
override float | Distance (Ray ray, bool frontOnly=false)
| Returns closest distance to the ray.
override float | Distance (ref Vector3 pos)
| Returns distance from the vector.
override float | DistanceLineSegment (ref Vector3 pos1, ref Vector3 pos2)
| Returns closest distance to the line segment. Generic, from center, OVERRIDE!
override float | DistanceSphere (ref Vector3 center, float radius)
| Returns closest distance to the sphere.
override float | DistanceTriangle (ref Vector3 pos1, ref Vector3 pos2, ref Vector3 pos3)
| Returns closest distance to the triangle.
override Point3DList | ToPoints (Type VertexType, float quality=0, int vertexlimit=0)
| Convert object to list of points.
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 float | Distance (IGeometry obj)
| Returns closest distance from the generic geometric object.
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.
void | RecalculateNormals ()
| Recalculates normal of the quad.
## Properties
override bool | IsPrimitive`[get]`
| Is object geometric renderable primitive from enumaration PrimitiveTypes?
override PrimitiveTypes | PreferredPrimitive`[get]`
| Preferred primitive type for rendering - quad likes quad.
override bool | IsContainer`[get]`
| quad is not container

## Detailed Description

Simple 3d quad (two triangles)

Note, for most test uses two triangles (slow, needs to be optimized)

## Constructor & Destructor Documentation

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

XML reader constructor.

Parameters:

  reader | XML reader

VisiMath.Geometry.Quad.Quad | ( |  | ) |

Constructs quad with standard vertex format (no values set)

VisiMath.Geometry.Quad.Quad | ( | Type | vertextype | ) |

Constructs quad of specified vertex type.

Parameters:

  vertextype |

VisiMath.Geometry.Quad.Quad | ( | IVertex | first,
|  | IVertex | second,
|  | IVertex | third,
|  | IVertex | fourth
| ) |  |

Constructs quad from three vertices. Note, all vertices should be of same format!

Parameters:

  first | first vertex
  second | second vertex
  third | third vertex
  fourth | fourth corner

VisiMath.Geometry.Quad.Quad | ( | Vector3 | first,
|  | Vector3 | second,
|  | Vector3 | third,
|  | Vector3 | fourth
| ) |  |

Constructs quad from three position vectors.

Parameters:

  first | first corner
  second | second corner
  third | third corner
  fourth | fourth corner

VisiMath.Geometry.Quad.Quad | ( | IVertexArray | vert | ) |

Constructs quad from the vertex array.

Parameters:

  vert | vertex array, should contain 3 vertex

VisiMath.Geometry.Quad.Quad | ( | IVertexArray | vert,
|  | int | startingindex
| ) |  |

Constructs quad from specified vertices in array.

Parameters:

  vert | Array holding vertices
  startingindex | Index of the first quadvertex

Exceptions:

  ArgumentException | Thrown if starting index is too high

## Member Function Documentation

override bool VisiMath.Geometry.Quad.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.Quad.Distance | ( | IGeometry | obj | ) | `[virtual]`

Returns closest distance from the generic geometric object.

Parameters:

  obj | Object to check distance with

Returns:
  Closest distance to the object

Reimplemented from VisiMath.Geometry.BaseGeometry.

override float VisiMath.Geometry.Quad.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.Quad.Distance | ( | ref Vector3 | pos | ) | `[virtual]`

Returns distance from the vector.

Parameters:

  pos |

Returns:

Reimplemented from VisiMath.Geometry.BaseGeometry.

override float VisiMath.Geometry.Quad.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.Quad.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.Quad.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.Quad.GetCopy | ( |  | ) | `[virtual]`

Returns copy of the geometric data.

Returns:
  Full copy of the geometry

Implements VisiMath.Geometry.BaseGeometry.

override bool VisiMath.Geometry.Quad.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.

override float VisiMath.Geometry.Quad.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.

void VisiMath.Geometry.Quad.RecalculateNormals | ( |  | ) |

Recalculates normal of the quad.

Implements VisiMath.Geometry.ISurfaceGeo.

override IndexedMesh VisiMath.Geometry.Quad.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 | Quality for parametric objects (0-1). Zero is simples possible, 1 maximal for the current dimension of the object. If vertexlimit parameter is used, quality will be reduced to fullfill maximal vertex budget
  VertexType | Required type of the vertex
  vertexlimit | Maximal number of allowed vertices. If set to zero, there's no limit. Used for fully parametric objects or to reduce number of the vertices in complicated objects.

Implements VisiMath.Geometry.BaseGeometry.

override LineList VisiMath.Geometry.Quad.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 | Quality for parametric objects (0-1). Zero is simples possible, 1 maximal for the current dimension of the object. If vertexlimit parameter is used, quality will be reduced to fullfill maximal vertex budget
  VertexType | Required type of the vertex
  vertexlimit | Maximal number of allowed vertices. If set to zero, there's no limit. Used for fully parametric objects or to reduce number of the vertices in complicated objects.

Implements VisiMath.Geometry.BaseGeometry.

override Point3DList VisiMath.Geometry.Quad.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 | Quality for parametric objects (0-1). Zero is simples possible, 1 maximal for the current dimension of the object. If vertexlimit parameter is used, quality will be reduced to fullfill maximal vertex budget
  VertexType | Required type of the vertex
  vertexlimit | Maximal number of allowed vertices. If set to zero, there's no limit. Used for fully parametric objects or to reduce number of the vertices in complicated objects.

Implements VisiMath.Geometry.BaseGeometry.

override TriangleList VisiMath.Geometry.Quad.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 | Quality for parametric objects (0-1). Zero is simples possible, 1 maximal for the current dimension of the object. If vertexlimit parameter is used, quality will be reduced to fullfill maximal vertex budget
  VertexType | Required type of the vertex
  vertexlimit | Maximal number of allowed vertices. If set to zero, there's no limit. Used for fully parametric objects or to reduce number of the vertices in complicated objects.

Implements VisiMath.Geometry.BaseGeometry.

## Property Documentation

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

quad is not container

Reimplemented from VisiMath.Geometry.BaseGeometry.

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

Is object geometric renderable primitive from enumaration PrimitiveTypes?

Reimplemented from VisiMath.Geometry.BaseGeometry.

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

Preferred primitive type for rendering - quad likes quad.

Reimplemented from VisiMath.Geometry.BaseGeometry.

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

- Quads.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events