Magnetoculus
Visualisation de champs en VR avec Oculus
|
Public Member Functions | |
void | Init (GameObject representation) |
List< Vector3 > | GetVertices () |
List< int > | GetBaseTriangles () |
List< Vector2 > | GetUV () |
GameObject | GetRepresentation () |
Vector3 | GetCentroid () |
void | Reset () |
void | AddVertex (Vector3 vertex) |
void | AddUV (Vector2 uv) |
virtual void | CleanUp () |
bool | PointInside (Vector3 p) |
bool | PointInside (Vector2 p2) |
void | Triangulate (int verticesOffset=0) |
void | AddToMeshInfo (MeshInformation meshInfo) |
bool | IsValid () |
Static Public Member Functions | |
static Polygon | CreateInstance (GameObject representation) |
Public Attributes | |
List< Vector2 > | m_Vertices2D |
Protected Attributes | |
GameObject | m_Representation |
List< Vector3 > | m_Vertices |
List< Vector2 > | m_UV |
List< int > | m_Triangles |
List< int > | m_BaseTriangles |
Vector3 | m_UX |
Vector3 | m_UY |
The abstraction used in all the generation processes.
void Polygon.AddToMeshInfo | ( | MeshInformation | meshInfo | ) |
void Polygon.AddUV | ( | Vector2 | uv | ) |
void Polygon.AddVertex | ( | Vector3 | vertex | ) |
|
virtual |
Cleans up the polygon by removing any possible duplicate vertex and corresponding attributes.
|
static |
List<int> Polygon.GetBaseTriangles | ( | ) |
Vector3 Polygon.GetCentroid | ( | ) |
GameObject Polygon.GetRepresentation | ( | ) |
List<Vector2> Polygon.GetUV | ( | ) |
List<Vector3> Polygon.GetVertices | ( | ) |
void Polygon.Init | ( | GameObject | representation | ) |
Init the lists and sets the representation to which the polygon belongs to.
bool Polygon.IsValid | ( | ) |
bool Polygon.PointInside | ( | Vector2 | p2 | ) |
Tells whether a point is inside the polygon or not. This assumes the origin to be at the first vertex.
bool Polygon.PointInside | ( | Vector3 | p | ) |
Tells whether a point is inside the polygon or not. This projects the point onto the polygon first.
void Polygon.Reset | ( | ) |
void Polygon.Triangulate | ( | int | verticesOffset = 0 | ) |
Triangulates the polygon, possibly applying an offset to the triangle indices. Also fills the 2D representation of the polygon. The triangulation is only calculated once then stored in m_BaseTriangles
. Calling this method several times will only change the offset and store the result in m_Triangles
.
|
protected |
List of untranslated triangulation indices.
|
protected |
The Representation to which this polygon belongs. This allow to delete the polygon when the representation is deleted.
|
protected |
The triangulation of the polygon is necessary to have any kind of display. The GPU needs a list of triangles in addition of the list of vertices.
|
protected |
The UV of the polygon is a Vector2 per vertex. It will be used by a mesh to map a texture onto the verices.
|
protected |
X axis of the 2D base of the polygon.
|
protected |
Y axis of the 2D base of the polygon.
|
protected |
The vertices of the polygon, stored as Vector3.
List<Vector2> Polygon.m_Vertices2D |
2D expression of the vertices of the polygon.