1 | // author: Barnabas Aszodi (BME-IIT)
|
---|
2 |
|
---|
3 | #include "Ogre.h"
|
---|
4 | #include "OgreEffectWrapper.h"
|
---|
5 | #include "ManagedOgreRenderTexturePass.h"
|
---|
6 | #include "CAURenderRefractObjectMapPass.h"
|
---|
7 |
|
---|
8 |
|
---|
9 | CAURenderRefractObjectMapPass::CAURenderRefractObjectMapPass(
|
---|
10 | Root* mRoot):ManagedOgreRenderTexturePass(mRoot,"NO_RENDER_TEXTURE",1,1)
|
---|
11 | {
|
---|
12 | effectWrapper->createMaterial("RenderRefractObj");
|
---|
13 | }
|
---|
14 |
|
---|
15 | void CAURenderRefractObjectMapPass::onRenderStart(NameValuePairList* namedParams){
|
---|
16 | effectWrapper->SetTechniqueToUse(0);
|
---|
17 | effectWrapper->BeginPass();
|
---|
18 | effectWrapper->SetVertexProgramParameters();
|
---|
19 | effectWrapper->SetMatrix("g_mWorldViewProj",g_mWorldViewProj);
|
---|
20 | effectWrapper->SetMatrix("g_mWorldEntityMesh",g_mWorldEntityMesh);
|
---|
21 | effectWrapper->SetVector3("g_vCameraPos3f",g_vCameraPos3f);
|
---|
22 | effectWrapper->SetFragmentProgramParameters();
|
---|
23 | effectWrapper->SetFloat("g_fFovCamera", g_fFovCamera);
|
---|
24 | }
|
---|
25 |
|
---|
26 |
|
---|
27 | void CAURenderRefractObjectMapPass::onRenderEnd(NameValuePairList* namedParams)
|
---|
28 | {
|
---|
29 | effectWrapper->EndPass();
|
---|
30 | }
|
---|
31 |
|
---|
32 | Matrix4 CAURenderRefractObjectMapPass::getWorldEntityMesh()
|
---|
33 | {
|
---|
34 | return g_mWorldEntityMesh;
|
---|
35 | }
|
---|
36 |
|
---|
37 | void CAURenderRefractObjectMapPass::setWorldEntityMesh( Matrix4 matrix4 )
|
---|
38 | {
|
---|
39 | g_mWorldEntityMesh = matrix4;
|
---|
40 | }
|
---|
41 |
|
---|
42 | Matrix4 CAURenderRefractObjectMapPass::getWorldViewProj()
|
---|
43 | {
|
---|
44 | return g_mWorldViewProj;
|
---|
45 | }
|
---|
46 |
|
---|
47 | void CAURenderRefractObjectMapPass::setWorldViewProj( Matrix4 matrix4 )
|
---|
48 | {
|
---|
49 | g_mWorldViewProj = matrix4;
|
---|
50 | }
|
---|
51 |
|
---|
52 | Vector3 CAURenderRefractObjectMapPass::getCameraPos3f()
|
---|
53 | {
|
---|
54 | return g_vCameraPos3f;
|
---|
55 | }
|
---|
56 |
|
---|
57 | void CAURenderRefractObjectMapPass::setCameraPos3f( Vector3 v )
|
---|
58 | {
|
---|
59 | g_vCameraPos3f = v;
|
---|
60 | }
|
---|
61 |
|
---|
62 | float CAURenderRefractObjectMapPass::getFovCamera()
|
---|
63 | {
|
---|
64 | return g_fFovCamera;
|
---|
65 | }
|
---|
66 |
|
---|
67 | void CAURenderRefractObjectMapPass::setFovCamera( float f )
|
---|
68 | {
|
---|
69 | g_fFovCamera = f;
|
---|
70 | }
|
---|