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/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 // IMPLEMENTATION
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 //    static SbVec3f farPoint(SbVec3f lightPos, SbVec3f point);
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

Generated on Wed May 17 17:27:52 2006 for Shadow Engine by  doxygen 1.4.6-NO