This model is created to be able generate shadow volumes independently of scene object plygon type. Model is created by addTriangleCallback called for every triangle. Model must be updated when the object shape changes or object's scale is updated.
Definition at line 68 of file ObjectModel.h.
Public Member Functions | |
CObjectModel () | |
Constructor. | |
~CObjectModel () | |
Destructor. | |
void | createFaceModel (SoSeparator *object) |
Create indexed Face Set model of the object in it's local coordinates. | |
SoSeparator * | getFaceModelNode () |
Returns the model root node. | |
int32_t | getTrianglesCount () |
Returns number of model triangles. | |
Public Attributes | |
SoCoordinate3 * | modelCoord3 |
Object model coordinates. | |
SoIndexedFaceSet * | modelIfs |
Object model polygon indices. | |
SoNormal * | modelNormal |
Object model normals. | |
int | coord3idx |
Object model polygon index. | |
Static Public Attributes | |
static SbVec3f | prevNormal |
Previous normal. | |
Static Private Member Functions | |
static SbVec3f | faceNormal (const SbVec3f p1, const SbVec3f p2, const SbVec3f p3) |
Computes the triangle normal vector from its verteces. | |
static void | TriangleCB (void *userdata, SoCallbackAction *action, const SoPrimitiveVertex *v1, const SoPrimitiveVertex *v2, const SoPrimitiveVertex *v3) |
Creates a SoIndexedFaceSet model of a an object. | |
Private Attributes | |
SoSeparator * | objectModelRoot |
Object model. | |
int32_t | nTriangles |
Number of triangles of the object. |
|
Constructor.
Definition at line 44 of file ObjectModel.cpp. References modelCoord3, modelIfs, nTriangles, and objectModelRoot. |
|
Destructor.
Definition at line 56 of file ObjectModel.cpp. References objectModelRoot. |
|
Computes the triangle normal vector from its verteces. Counterclockwise orientation.
Definition at line 73 of file ObjectModel.cpp. References ONDEBUG. Referenced by TriangleCB(). |
|
Creates a SoIndexedFaceSet model of a an object. This CB is called for every polygon in scene graph.
Definition at line 114 of file ObjectModel.cpp. References coord3idx, faceNormal(), modelCoord3, modelIfs, modelNormal, and nTriangles. Referenced by createFaceModel(). |
|
Create indexed Face Set model of the object in it's local coordinates.
Definition at line 186 of file ObjectModel.cpp. References coord3idx, modelCoord3, modelIfs, modelNormal, nTriangles, objectModelRoot, ONDEBUG, and TriangleCB(). Referenced by SoShadowCaster::createFaceModel(). |
|
Returns the model root node.
Definition at line 233 of file ObjectModel.cpp. References objectModelRoot. Referenced by SoShadowCaster::showFaceModel(). |
|
Returns number of model triangles.
Definition at line 242 of file ObjectModel.cpp. References nTriangles. |
|
Object model.
Definition at line 72 of file ObjectModel.h. Referenced by CObjectModel(), createFaceModel(), getFaceModelNode(), and ~CObjectModel(). |
|
Number of triangles of the object.
Definition at line 74 of file ObjectModel.h. Referenced by CObjectModel(), createFaceModel(), getTrianglesCount(), and TriangleCB(). |
|
Object model coordinates.
Definition at line 85 of file ObjectModel.h. Referenced by CObjectModel(), createFaceModel(), and TriangleCB(). |
|
Object model polygon indices.
Definition at line 87 of file ObjectModel.h. Referenced by CObjectModel(), createFaceModel(), and TriangleCB(). |
|
Object model normals.
Definition at line 89 of file ObjectModel.h. Referenced by createFaceModel(), and TriangleCB(). |
|
Object model polygon index.
Definition at line 91 of file ObjectModel.h. Referenced by createFaceModel(), and TriangleCB(). |
|
Previous normal.
Definition at line 94 of file ObjectModel.h. |