Polyhedron implementation.
Originally this was designed for convex polyhedrons but now we can deal with non-convex ones also.
Note that we can have cylinders, spheres and general polyhedrons (geomview non-colored OFFs) However, the shapes are only used for display purposes since internally all objects are represented/approximated as polyhedrons (i.e., OFFs). This is specially relevant for collision detection since a polytope approximating the cylinder and the sphere is used. The granularity of this approximation adjusted in the .world files.
See InitPolyhedronFromFile for more details.
- See Also
- polyhedron.h, polyhedron.c.
Definition at line 124 of file polyhedron.h.
unsigned int Tpolyhedron::type |
Type of body: SEGMENTS, LINE, CYLINDER, SPHERE, OFF.
Definition at line 125 of file polyhedron.h.
Referenced by CopyPolyhedron(), GenerateCylinderOFF(), GenerateSphereOFF(), GetPolyhedronCenter(), GetPolyhedronDefiningPoint(), GetPolyhedronRadius(), GetPolyhedronType(), InitPolyhedronFromTriangles(), NewBox(), NewCylinder(), NewLine(), NewSegments(), NewSphere(), PlotPolyhedron(), PolyhedronPrintCenter(), PolyhedronPrintCenterAndCenter(), PrintPolyhedron(), ReadCylinder(), ReadGeneralMesh(), ReadLine(), ReadOFF(), ReadSegments(), ReadSphere(), ReadSTL(), and SavePolyhedron().
unsigned int Tpolyhedron::status |
Display status of the body: NORMAL (shown and used for collision detection), HIDDEN (not shown, but used in collision detection), DECOR (shown but not used in collision detection).
Definition at line 127 of file polyhedron.h.
Referenced by CopyPolyhedron(), GetPolyhedronStatus(), InitPolyhedronFromFile(), InitPolyhedronFromTriangles(), MovePolyhedron(), NewBox(), NewCylinder(), NewLine(), NewSegments(), NewSphere(), PlotPolyhedron(), and PrintPolyhedron().
The color of the body.
Definition at line 131 of file polyhedron.h.
Referenced by CopyPolyhedron(), GetPolyhedronColor(), InitPolyhedronFromFile(), InitPolyhedronFromTriangles(), NewBox(), NewCylinder(), NewLine(), NewSegments(), NewSphere(), PlotPolyhedron(), PrintPolyhedron(), and SetPolyhedronColor().
unsigned int Tpolyhedron::obj3d |
unsigned int Tpolyhedron::nv |
Number of vertices.
Definition at line 135 of file polyhedron.h.
Referenced by CopyPolyhedron(), DeletePolyhedron(), GenerateCylinderOFF(), GenerateSphereOFF(), GetOFFInfo(), GetPolyhedronNVertex(), GetPolyhedronVertex(), InitPolyhedronFromTriangles(), NewBox(), NewSegments(), PlotPolyhedron(), PrintPolyhedron(), ReadGeneralMesh(), ReadOFF(), ReadSegments(), ReadSTL(), SavePolyhedron(), and TransformPolyhedron().
unsigned int Tpolyhedron::nf |
Number of faces.
Definition at line 136 of file polyhedron.h.
Referenced by CopyPolyhedron(), DeletePolyhedron(), GenerateCylinderOFF(), GenerateSphereOFF(), GetOFFInfo(), InitPolyhedronFromTriangles(), NewBox(), NewSegments(), PlotPolyhedron(), ReadGeneralMesh(), ReadOFF(), ReadSegments(), ReadSTL(), and SavePolyhedron().
unsigned int Tpolyhedron::ne |
Number of edges (not used).
Definition at line 137 of file polyhedron.h.
Referenced by CopyPolyhedron(), GenerateCylinderOFF(), GenerateSphereOFF(), InitPolyhedronFromTriangles(), NewBox(), NewSegments(), PlotPolyhedron(), ReadGeneralMesh(), ReadOFF(), ReadSegments(), and ReadSTL().
The vertices (3d points).
Definition at line 138 of file polyhedron.h.
Referenced by CopyPolyhedron(), DeletePolyhedron(), GenerateCylinderOFF(), GenerateSphereOFF(), GetOFFInfo(), GetPolyhedronVertex(), InitPolyhedronFromTriangles(), NewBox(), NewSegments(), PlotPolyhedron(), PrintPolyhedron(), ReadGeneralMesh(), ReadOFF(), ReadSegments(), ReadSTL(), SavePolyhedron(), and TransformPolyhedron().
unsigned int* Tpolyhedron::nvf |
Number of vertices per face.
Definition at line 139 of file polyhedron.h.
Referenced by CopyPolyhedron(), DeletePolyhedron(), GenerateCylinderOFF(), GenerateSphereOFF(), GetOFFInfo(), InitPolyhedronFromTriangles(), NewBox(), NewSegments(), PlotPolyhedron(), ReadGeneralMesh(), ReadOFF(), ReadSegments(), ReadSTL(), and SavePolyhedron().
unsigned int** Tpolyhedron::fv |
Face vertices.
Definition at line 140 of file polyhedron.h.
Referenced by CopyPolyhedron(), DeletePolyhedron(), GenerateCylinderOFF(), GenerateSphereOFF(), GetOFFInfo(), InitPolyhedronFromTriangles(), NewBox(), PlotPolyhedron(), ReadGeneralMesh(), ReadOFF(), ReadSTL(), and SavePolyhedron().
Radius of the sphere/cylinder.
Definition at line 142 of file polyhedron.h.
Referenced by CopyPolyhedron(), GenerateCylinderOFF(), GenerateSphereOFF(), GetPolyhedronRadius(), InitPolyhedronFromTriangles(), NewBox(), NewCylinder(), NewLine(), NewSegments(), NewSphere(), PlotPolyhedron(), PolyhedronPrintCenterAndCenter(), PrintPolyhedron(), ReadCylinder(), ReadLine(), ReadOFF(), ReadSegments(), ReadSphere(), and SavePolyhedron().
double Tpolyhedron::center[3] |
Center of the sphere.
Definition at line 144 of file polyhedron.h.
Referenced by CopyPolyhedron(), GenerateSphereOFF(), GetPolyhedronCenter(), GetPolyhedronDefiningPoint(), InitPolyhedronFromTriangles(), NewBox(), NewCylinder(), NewLine(), NewSegments(), NewSphere(), PlotPolyhedron(), PolyhedronPrintCenter(), PolyhedronPrintCenterAndCenter(), PrintPolyhedron(), ReadCylinder(), ReadLine(), ReadOFF(), ReadSegments(), ReadSphere(), SavePolyhedron(), and TransformPolyhedron().
double Tpolyhedron::p1[3] |
Origin of the cylinder axes.
Definition at line 146 of file polyhedron.h.
Referenced by CopyPolyhedron(), GenerateCylinderOFF(), GetPolyhedronDefiningPoint(), InitPolyhedronFromTriangles(), NewBox(), NewCylinder(), NewLine(), NewSegments(), NewSphere(), PlotPolyhedron(), PrintPolyhedron(), ReadCylinder(), ReadLine(), ReadOFF(), ReadSegments(), ReadSphere(), SavePolyhedron(), and TransformPolyhedron().
double Tpolyhedron::p2[3] |
End of the cylinder axes.
Definition at line 147 of file polyhedron.h.
Referenced by CopyPolyhedron(), GenerateCylinderOFF(), GetPolyhedronDefiningPoint(), InitPolyhedronFromTriangles(), NewBox(), NewCylinder(), NewLine(), NewSegments(), NewSphere(), PlotPolyhedron(), PrintPolyhedron(), ReadCylinder(), ReadLine(), ReadOFF(), ReadSegments(), ReadSphere(), SavePolyhedron(), and TransformPolyhedron().
double Tpolyhedron::maxCoord |
Maximum of the X,Y,Z coordinates used to represent the polyhedron. This provides a conservative bounding box for this object.
Definition at line 149 of file polyhedron.h.
Referenced by CopyPolyhedron(), GenerateCylinderOFF(), GenerateSphereOFF(), GetPolyhedronMaxCoordinate(), InitPolyhedronFromTriangles(), NewBox(), NewSegments(), ReadOFF(), ReadSegments(), and TransformPolyhedron().
|
Follow us!