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 "OgreRenderTechnique.h"
|
---|
11 | #include "Ogre.h"
|
---|
12 |
|
---|
13 | using namespace Ogre;
|
---|
14 |
|
---|
15 | /**
|
---|
16 | @brief TriggersRenderTechnique used in an OGRE environment.
|
---|
17 | */
|
---|
18 | class OgreTriggersRenderTechnique : public OgreRenderTechnique
|
---|
19 | {
|
---|
20 | public:
|
---|
21 | /**
|
---|
22 | @brief Constructor.
|
---|
23 |
|
---|
24 | @param depthTexID the id of the texture unit state the resulting
|
---|
25 | scene depth map should be bound to
|
---|
26 | @param pass the pass to operate on
|
---|
27 | @param parentRenderable the object to operate on
|
---|
28 | @param parentTechniqueGroup the TechniqueGroup this RenderedTechnique is attached to
|
---|
29 | */
|
---|
30 | OgreTriggersRenderTechnique(
|
---|
31 | IllumTechniqueParams* params,
|
---|
32 | Pass* pass,
|
---|
33 | OgreRenderable* parentRenderable,
|
---|
34 | OgreTechniqueGroup* parentTechniqueGroup
|
---|
35 | ):OgreRenderTechnique(pass,parentRenderable,parentTechniqueGroup),
|
---|
36 | RenderTechnique(parentRenderable, parentTechniqueGroup)
|
---|
37 | {
|
---|
38 | NameValuePairList& triggers = params->getParams();
|
---|
39 |
|
---|
40 | NameValuePairList::iterator it = triggers.begin();
|
---|
41 | NameValuePairList::iterator itend = triggers.end();
|
---|
42 |
|
---|
43 | while(it != itend)
|
---|
44 | {
|
---|
45 | parentTechniqueGroup->setMaterialForTrigger((*it).first, (*it).second);
|
---|
46 | it++;
|
---|
47 | }
|
---|
48 | }
|
---|
49 | virtual ~OgreTriggersRenderTechnique(){}
|
---|
50 |
|
---|
51 | };
|
---|
52 |
|
---|
53 | /**
|
---|
54 | @brief RenderTechniqueFactory to create OgreSBBRenderTechnique instances.
|
---|
55 | */
|
---|
56 | class OgreTriggersRenderTechniqueFactory : public RenderTechniqueFactory
|
---|
57 | {
|
---|
58 | public:
|
---|
59 |
|
---|
60 | OgreTriggersRenderTechniqueFactory()
|
---|
61 | {
|
---|
62 | typeName = "Triggers";
|
---|
63 | }
|
---|
64 |
|
---|
65 | OgreRenderTechnique* createInstance(IllumTechniqueParams* params,
|
---|
66 | Pass* pass,
|
---|
67 | OgreRenderable* parentRenderable,
|
---|
68 | OgreTechniqueGroup* parentTechniqueGroup)
|
---|
69 | {
|
---|
70 | OgreTriggersRenderTechnique* result = new OgreTriggersRenderTechnique(
|
---|
71 | params,
|
---|
72 | pass,
|
---|
73 | parentRenderable,
|
---|
74 | parentTechniqueGroup);
|
---|
75 | return result;
|
---|
76 | }
|
---|
77 |
|
---|
78 | };
|
---|
79 |
|
---|
80 |
|
---|
81 |
|
---|