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/SoSeparator.h>
00041 #include <Inventor/nodes/SoLight.h>
00042 #include <Inventor/nodes/SoCoordinate3.h>
00043 #include <Inventor/nodes/SoNormal.h>
00044 #include <Inventor/nodes/SoMaterial.h>
00045 #include <Inventor/nodes/SoMatrixTransform.h>
00046 #include <Inventor/nodes/SoShapeHints.h>
00047 #include <Inventor/nodes/SoPointLight.h>
00048 #include <Inventor/nodes/SoIndexedTriangleStripSet.h>
00049 #include <Inventor/nodes/SoTriangleStripSet.h>
00050 #include <Inventor/nodes/SoTransform.h>
00051
00052 #include <Inventor/SbLinear.h>
00053 #include <Inventor/SoOutput.h>
00054
00055 #include <Inventor/fields/SoSFVec3f.h>
00056 #include <Inventor/fields/SoMFVec3f.h>
00057
00058 #include <Inventor/actions/SoSearchAction.h>
00059 #include <Inventor/actions/SoGetMatrixAction.h>
00060 #include <Inventor/actions/SoWriteAction.h>
00061 #include <Inventor/actions/SoCallbackAction.h>
00062
00063 #include <Inventor/misc/SoChildList.h>
00064
00065
00066
00067
00068
00075 class SoShadowVolume : public SoSeparator
00076 {
00077 private:
00079 SoShadowLight * shadowlight;
00081 SoLight * aLight;
00083 SoShadowCaster * caster;
00085 CObjectModel * objectModel;
00087 SbMatrix * trMatrix;
00089 SoCoordinate3 * coordNode;
00091 SbColor svColor;
00093 SoTransform * transform;
00095 int casterName;
00096
00097 void init();
00098
00099 public:
00101 int32_t nScTr;
00103 int32_t nSVTr;
00104
00105 SoShadowVolume(SoShadowLight * l, int cn);
00106 ~SoShadowVolume();
00107
00108 void create();
00109 int getCasterName();
00110 void writeShadowVolume(const char *filename);
00111
00112
00113 static SbVec3f faceNormal(const SbVec3f p1, const SbVec3f p2, const SbVec3f p3);
00114 static SbVec3f farPointNew(SbVec3f lightVec, SbVec3f point, float farDepth);
00115
00116 };
00117
00118 #endif