Tpolyhedron Struct Reference

Detailed Description

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.

Data Fields

unsigned int type
 
unsigned int status
 
Tcolor color
 
unsigned int obj3d
 
unsigned int nv
 
unsigned int nf
 
unsigned int ne
 
double ** v
 
unsigned int * nvf
 
unsigned int ** fv
 
double rad
 
double center [3]
 
double p1 [3]
 
double p2 [3]
 
double maxCoord
 

Field Documentation

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().

unsigned int Tpolyhedron::obj3d

Identifier of the body. Used when plotting (see Tplot3d).

Definition at line 133 of file polyhedron.h.

Referenced by CopyPolyhedron(), InitPolyhedronFromFile(), InitPolyhedronFromTriangles(), MovePolyhedron(), NewBox(), NewCylinder(), NewLine(), NewSegments(), NewSphere(), and PlotPolyhedron().

unsigned int Tpolyhedron::ne
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().