00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef SO_SHADOW_VOLUME__H
00029 #define SO_SHADOW_VOLUME__H
00030
00031
00032
00033
00034
00035 #include "ShadowManager.h"
00036 #include "ObjectModel.h"
00037 #include "SoShadowCaster.h"
00038 #include "SoShadowLight.h"
00039
00040 #include <Inventor/nodes/SoGroup.h>
00041 #include <Inventor/nodes/SoSeparator.h>
00042 #include <Inventor/nodes/SoLight.h>
00043 #include <Inventor/nodes/SoCoordinate3.h>
00044 #include <Inventor/nodes/SoNormal.h>
00045 #include <Inventor/nodes/SoMaterial.h>
00046 #include <Inventor/nodes/SoMatrixTransform.h>
00047 #include <Inventor/nodes/SoShapeHints.h>
00048 #include <Inventor/nodes/SoPointLight.h>
00049 #include <Inventor/nodes/SoIndexedTriangleStripSet.h>
00050 #include <Inventor/nodes/SoTriangleStripSet.h>
00051 #include <Inventor/nodes/SoTransform.h>
00052
00053 #include <Inventor/SbLinear.h>
00054 #include <Inventor/SoOutput.h>
00055
00056 #include <Inventor/fields/SoSFVec3f.h>
00057 #include <Inventor/fields/SoMFVec3f.h>
00058
00059 #include <Inventor/actions/SoSearchAction.h>
00060 #include <Inventor/actions/SoGetMatrixAction.h>
00061 #include <Inventor/actions/SoWriteAction.h>
00062 #include <Inventor/actions/SoCallbackAction.h>
00063
00064 #include <Inventor/misc/SoChildList.h>
00065
00066
00067
00068
00069
00076 class SoShadowVolume : public SoSeparator
00077 {
00078 private:
00080 SoShadowLight * shadowlight;
00082 SoLight * aLight;
00084 SoShadowCaster * caster;
00086 CObjectModel * objectModel;
00088 SbMatrix * trMatrix;
00090 SoCoordinate3 * coordNode;
00092 SbColor svColor;
00094 SoTransform * transform;
00096 int casterName;
00098 SoGroup * initNode;
00100 SoGroup * volumeNode;
00101
00102 void init();
00103
00104 public:
00106 int32_t nScTr;
00108 int32_t nSVTr;
00109
00110 SoShadowVolume(SoShadowLight * l, int cn);
00111 ~SoShadowVolume();
00112
00113 void create();
00114 int getCasterName();
00115 void writeShadowVolume(const char *filename);
00116
00117
00118 static SbVec3f faceNormal(const SbVec3f p1, const SbVec3f p2, const SbVec3f p3);
00119 static SbVec3f farPointNew(SbVec3f lightVec, SbVec3f point, float farDepth);
00120
00121 };
00122
00123 #endif