[3255] | 1 | #pragma once
|
---|
| 2 |
|
---|
| 3 | //disable inheritance warning caused by multiple inheritance
|
---|
| 4 | #if _WIN32
|
---|
| 5 | #if _MSC_VER
|
---|
| 6 | #pragma warning(disable: 4250)
|
---|
| 7 | #endif
|
---|
| 8 | #endif
|
---|
| 9 |
|
---|
| 10 | #include "OgreRenderingRun.h"
|
---|
| 11 | #include "ChildPSystemRenderingRun.h"
|
---|
| 12 | #include "OgreSharedRuns.h"
|
---|
| 13 |
|
---|
| 14 |
|
---|
| 15 | /**
|
---|
| 16 | @brief ChildPsystemRenderingRun used in an OGRE environment.
|
---|
| 17 | */
|
---|
| 18 | class __declspec( dllexport ) OgreChildPSystemRenderingRun : public OgreRenderingRun,
|
---|
| 19 | public ChildPsystemRenderingRun
|
---|
| 20 | {
|
---|
| 21 | public:
|
---|
| 22 |
|
---|
| 23 | /**
|
---|
| 24 | @brief Constructor.
|
---|
| 25 |
|
---|
| 26 | @param sharedRuns a pointer to the OgreSharedRuns this run belongs to
|
---|
| 27 | @param name the name of the texture to be created
|
---|
| 28 | @param startFrame adds an offset to the current frame number to help evenly distribute updates between frames
|
---|
| 29 | @param updateInterval update frequency
|
---|
| 30 | @param resolution resolution of the impostor texture
|
---|
| 31 | @param perspectiveRendering sets if the impostor should be rendered with a perspective projection or orthogonal
|
---|
| 32 | @param childPSysScriptName the name of the particle system script
|
---|
| 33 | @param useOwnMaterial use the material that was defined in the particle script
|
---|
| 34 | @param materialName use this specific material while rendering the impostor
|
---|
| 35 |
|
---|
| 36 | */
|
---|
| 37 | OgreChildPSystemRenderingRun(OgreSharedRuns* sharedRuns,
|
---|
| 38 | String name,
|
---|
| 39 | unsigned long startFrame,
|
---|
| 40 | unsigned long updateInterval,
|
---|
| 41 | unsigned int resolution,
|
---|
| 42 | bool perspectiveRendering,
|
---|
| 43 | String childParticleSystemName,
|
---|
| 44 | String particleScriptName,
|
---|
| 45 | bool useOwnMaterial,
|
---|
| 46 | String materialName
|
---|
| 47 | );
|
---|
| 48 |
|
---|
| 49 | virtual ~OgreChildPSystemRenderingRun(){}
|
---|
| 50 |
|
---|
| 51 | /**
|
---|
| 52 | @brief returns the name of the resulting photon hit map
|
---|
| 53 | */
|
---|
| 54 | String getImpostorTextureName(){return name;}
|
---|
| 55 | //inherited
|
---|
| 56 | bool canJoin(RenderingRun* run)
|
---|
| 57 | {
|
---|
| 58 |
|
---|
| 59 | return false;
|
---|
| 60 | }
|
---|
| 61 | void setNode(SceneNode* n){psysNode = n;}
|
---|
| 62 | /**
|
---|
| 63 | @brief Returns the radius of the small particle system.
|
---|
| 64 | */
|
---|
| 65 | Real getSmallSysRadius(){return sysRad;}
|
---|
| 66 |
|
---|
| 67 | void freeAllResources();
|
---|
| 68 |
|
---|
| 69 | protected:
|
---|
| 70 | SceneNode* psysNode;
|
---|
| 71 | /**
|
---|
| 72 | @brief Sets if the impostor should be rendered with a perspective projection or orthogonal.
|
---|
| 73 | */
|
---|
| 74 | bool perspectiveRendering;
|
---|
| 75 | /**
|
---|
| 76 | @brief Use the material that was defined in the particle script.
|
---|
| 77 | */
|
---|
| 78 | bool useOwnMaterial;
|
---|
| 79 | /**
|
---|
| 80 | @brief Use this specific material while rendering the impostor.
|
---|
| 81 | */
|
---|
| 82 | String materialName;
|
---|
| 83 | /**
|
---|
| 84 | @brief The name of the small particle system.
|
---|
| 85 | */
|
---|
| 86 | String childParticleSystemName;
|
---|
| 87 | /**
|
---|
| 88 | @brief The name of the small particle system script.
|
---|
| 89 | */
|
---|
| 90 | String particleScriptName;
|
---|
| 91 | /**
|
---|
| 92 | @brief Radius of the small particle system.
|
---|
| 93 | */
|
---|
| 94 | Real sysRad;
|
---|
| 95 | /**
|
---|
| 96 | @brief Camera used while rendering the impostor image.
|
---|
| 97 | */
|
---|
| 98 | Camera* impostorCamera;
|
---|
| 99 | /**
|
---|
| 100 | @brief A pointer to the OgreSharedRuns this run belongs to.
|
---|
| 101 | */
|
---|
| 102 | OgreSharedRuns* sharedRuns;
|
---|
| 103 | /**
|
---|
| 104 | @brief The name of the imostor texture that was created by this run.
|
---|
| 105 | */
|
---|
| 106 | String name;
|
---|
| 107 | /**
|
---|
| 108 | @brief A pointer to the impostor texture that was created by this run.
|
---|
| 109 | */
|
---|
| 110 | Texture* impostorTexture;
|
---|
| 111 |
|
---|
| 112 |
|
---|
| 113 | //inherited
|
---|
| 114 | void updateFrame(unsigned long frameNum);
|
---|
| 115 | //inherited
|
---|
| 116 | inline void createImpostorTexture();
|
---|
| 117 |
|
---|
| 118 | };
|
---|