SoShadowVolume.h

Go to the documentation of this file.
00001 
00007 /* ---------------------------------------------------------------------------
00008  * Authors:      Tomáš Burian (tburian _AT centrum.cz)
00009  * Thanks to:    PCJohn (peciva _AT fit.vutbr.cz)
00010  * Contributors:
00011  *
00012  * THIS SOFTWARE IS NOT COPYRIGHTED
00013  *
00014  * This source code is offered for use in the public domain.
00015  * You may use, modify or distribute it freely.
00016  *
00017  * This source code is distributed in the hope that it will be useful but
00018  * WITHOUT ANY WARRANTY.  ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
00019  * DISCLAIMED.  This includes but is not limited to warranties of
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00021  *
00022  * If you find the source code useful, authors will kindly welcome
00023  * if you give them credit and keep their names with their source code,
00024  * but do not feel to be forced to do so.
00025  * ---------------------------------------------------------------------------
00026  */
00027 
00028 #ifndef SO_SHADOW_VOLUME__H
00029 #define SO_SHADOW_VOLUME__H
00030 
00031 //----------------------------------------------------------------------------
00032 // INCLUDEs
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 // IMPLEMENTATION
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 //    static SbVec3f farPoint(SbVec3f lightPos, SbVec3f point);
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

Generated on Wed May 17 08:24:45 2006 for Shadow Engine by  doxygen 1.4.6-NO