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_CASTER__H
00029 #define SO_SHADOW_CASTER__H
00030
00031
00032
00033
00034
00035 #include "ShadowManager.h"
00036 #include "ObjectModel.h"
00037
00038 #include <Inventor/nodes/SoSeparator.h>
00039 #include <Inventor/nodes/SoCoordinate3.h>
00040 #include <Inventor/nodes/SoNormal.h>
00041 #include <Inventor/nodes/SoNormalBinding.h>
00042 #include <Inventor/nodes/SoShapeHints.h>
00043 #include <Inventor/nodes/SoIndexedFaceSet.h>
00044 #include <Inventor/nodes/SoTranslation.h>
00045 #include <Inventor/nodes/SoRotationXYZ.h>
00046
00047 #include <Inventor/actions/SoCallbackAction.h>
00048 #include <Inventor/actions/SoSearchAction.h>
00049 #include <Inventor/actions/SoGetMatrixAction.h>
00050 #include <Inventor/actions/SoWriteAction.h>
00051
00052 #include <Inventor/elements/SoShapeHintsElement.h>
00053
00054 #include <Inventor/misc/SoChildList.h>
00055
00056 #include <Inventor/SoPrimitiveVertex.h>
00057 #include <Inventor/SbLinear.h>
00058
00059
00060
00061
00062
00071 class SoShadowCaster : public SoSeparator
00072 {
00073 public:
00075 CObjectModel * objectModel;
00077 SbMatrix trMatrix;
00079 SbMatrix trMatrixOld;
00081 SoPath * path;
00083 SoSeparator * objectRoot;
00084
00085 private:
00087 CShadowManager * manager;
00089 int nameIndex;
00091 SoPathSensor * moveSensor;
00093 SoNodeSensor * shapeSensor;
00095 bool hasMoved;
00096
00097 bool getTransformationMatrix();
00098
00099 public:
00100 SoShadowCaster(CShadowManager * sm, SoSeparator * or);
00101 ~SoShadowCaster();
00102
00103 SoSeparator * getObjectNode();
00104 CObjectModel * getObjectModel();
00105 SbMatrix * getMatrix();
00106 void setCasterName(int objectIndex);
00107 int getCasterName();
00108
00109 void setMoveSensor(SoPathSensor * sensor);
00110 void setShapeSensor(SoNodeSensor * sensor);
00111 SoPathSensor * getMoveSensor();
00112 SoNodeSensor * getShapeSensor();
00113
00114 void createFaceModel();
00115 void showFaceModel();
00116 void createShadowVolumes();
00117
00118 void setMoved(bool m);
00119 bool moved();
00120
00121 };
00122
00123
00124 #endif