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
VisiMath.Geometry.ColTriangle Struct Reference

Optimized triangle with all values precalculated to speed up tests. More...

List of all members.

## Public Member Functions
void | Reconstruct ()
| Reconstruct triangle from already set Points.
void | Construct (Vector3 p1, Vector3 p2, Vector3 p3)
| Constructs triagnle data from three points (must be in clockwise order!)
void | Construct (ref Vector3 p1, ref Vector3 p2, ref Vector3 p3)
| Constructs triagnle data from three points (must be in clockwise order!)
float | SquaredDistance (ref Vector3 center)
| Calculates squared distance from the the point.
float | Distance (ref Vector3 vec)
| Calculates distance from the the point.
Vector3 | ClosestPoint (ref Vector3 point)
| Calculates closest point on the triangle to point.
void | ClosestPoint (ref Vector3 p, out Vector3 vec)
| Calculates closest point on the triangle to point.
float | RayIntersection (ref Vector3 origin, ref Vector3 normal)
| Calculates ray intersection.
bool | IntersectionSphere (ref Vector3 center, float radius, out Vector3 TriPoint, out float penetration)
| Calculates intersection of the sphere and triangle.
void | GetLocalSupportingVertex (ref Vector3 direction, out Vector3 vertex)
| Gets supporting vertex in local coordinates.
## Public Attributes
Vector3[] | Points
| Points of the triangle.
Vector3[] | Edges
| Edge vectors - p2-p1, p3-p2, p3-p1.
Vector3 | Normal
| Normal vector.
float[] | Length
| Length of the edges.
float | D
| D parameter for plane equation.
object | UserData
| User data to store inside the triangle.

## Detailed Description

Optimized triangle with all values precalculated to speed up tests.

## Member Function Documentation

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

Calculates closest point on the triangle to point.

Parameters:

  point | Point in space

Returns:
  Closest point on triangle

void VisiMath.Geometry.ColTriangle.ClosestPoint | ( | ref Vector3 | p,
|  | out Vector3 | vec
| ) |  |

Calculates closest point on the triangle to point.

Parameters:

  p | Point in space
  vec | Closest point on triangle

void VisiMath.Geometry.ColTriangle.Construct | ( | ref Vector3 | p1,
|  | ref Vector3 | p2,
|  | ref Vector3 | p3
| ) |  |

Constructs triagnle data from three points (must be in clockwise order!)

Parameters:

  p1 |
  p2 |
  p3 |

void VisiMath.Geometry.ColTriangle.Construct | ( | Vector3 | p1,
|  | Vector3 | p2,
|  | Vector3 | p3
| ) |  |

Constructs triagnle data from three points (must be in clockwise order!)

Parameters:

  p1 |
  p2 |
  p3 |

float VisiMath.Geometry.ColTriangle.Distance | ( | ref Vector3 | vec | ) |

Calculates distance from the the point.

Parameters:

  vec | position

Returns:
  Distance form the vector

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

Gets supporting vertex in local coordinates.

Parameters:

  vertex | Save vertex
  direction | Direction vector

bool VisiMath.Geometry.ColTriangle.IntersectionSphere | ( | ref Vector3 | center,
|  | float | radius,
|  | out Vector3 | TriPoint,
|  | out float | penetration
| ) |  |

Calculates intersection of the sphere and triangle.

Parameters:

  center | Center of the sphere
  radius | Radius

param name="penetration">Penetration value

param name="TriPoint">Point on the triangle

Returns:
  True if intersection exists

float VisiMath.Geometry.ColTriangle.RayIntersection | ( | ref Vector3 | origin,
|  | ref Vector3 | normal
| ) |  |

Calculates ray intersection.

Parameters:

  origin |
  normal |

Returns:

void VisiMath.Geometry.ColTriangle.Reconstruct | ( |  | ) |

Reconstruct triangle from already set Points.

float VisiMath.Geometry.ColTriangle.SquaredDistance | ( | ref Vector3 | center | ) |

Calculates squared distance from the the point.

Parameters:

  center | position

Returns:
  Squared Distance form the vector

## Member Data Documentation

float VisiMath.Geometry.ColTriangle.D

D parameter for plane equation.

Vector3 [] VisiMath.Geometry.ColTriangle.Edges

Edge vectors - p2-p1, p3-p2, p3-p1.

float [] VisiMath.Geometry.ColTriangle.Length

Length of the edges.

Vector3 VisiMath.Geometry.ColTriangle.Normal

Normal vector.

Vector3 [] VisiMath.Geometry.ColTriangle.Points

Points of the triangle.

object VisiMath.Geometry.ColTriangle.UserData

User data to store inside the triangle.

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

- ColTriangle.cs

All Classes Namespaces Files Functions Variables Enumerations Properties Events