MCPcopy Create free account
hub / github.com/carbonengine/trinity / Tr2InteriorScene

Method Tr2InteriorScene

trinity/Interior/Tr2InteriorScene.cpp:113–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113Tr2InteriorScene::Tr2InteriorScene( IRoot* lockobj /*= NULL */ ) :
114 PARENTLOCK( m_lights ),
115 PARENTLOCK( m_dynamics ),
116 PARENTLOCK( m_dynamicsPendingLoad ),
117 PARENTLOCK( m_curveSets ),
118 PARENTLOCK( m_lightRenderTargets ),
119 m_shadowSize( 1024 ),
120 m_sunDirection( 0.0f, 0.0f, 1.0f ),
121 m_sunDiffuseColor( 0.0f, 0.0f, 0.0f, 1.0f ),
122 m_sunSpecularColor( 0.8f, 0.8f, 0.8f, 1.0f ),
123 m_ambientColor( 0.0f, 0.0f, 0.0f, 0.0f ),
124 m_lastUpdateTime( 0 ),
125 m_visualizeMethod( VM_NONE ),
126 m_pickBuffer( NULL, Tr2RenderContextEnum::PIXEL_FORMAT_R32G32B32A32_FLOAT, 1 ),
127 m_maxFogAmount( 0.0f ),
128 m_maxFogDistance( 1000.0f ),
129 m_minFogDistance( 0.0f ),
130 m_shadowCount( 4 ),
131 m_fogColor( 1.0f, 1.0f, 1.0f, 1.0f ),
132 m_renderBackgroundCubeMap( true ),
133 m_sunDiffuseColorVar( "Sun.WodDiffuseColor", m_sunDiffuseColor ),
134 m_sunSpecularColorVar( "Sun.SpecularColor", m_sunSpecularColor ),
135 m_ambientColorVar( "Scene.AmbientColor", m_ambientColor ),
136 m_cameraPosVar( "Camera.eyePosWorld", Vector3( 0.0f, 0.0f, 0.0f ) ),
137 m_optimizeShadows( true ),
138 m_renderShadows( true ),
139 m_debugRenderShadowMaps( false ),
140 m_shadowMap0Var( "SpotlightShadow0", (TriTextureRes*)NULL ),
141 m_shadowMap1Var( "SpotlightShadow1", (TriTextureRes*)NULL ),
142 m_shadowMap2Var( "SpotlightShadow2", (TriTextureRes*)NULL ),
143 m_shadowMap3Var( "SpotlightShadow3", (TriTextureRes*)NULL )
144{
145 m_backgroundCubeMapVar.Register( "EnvMap1", m_backgroundCubeMapRes );
146
147 GlobalStore().RegisterVariable( "LightPrePassMap", (TriTextureRes*)NULL );
148 GlobalStore().RegisterVariable( "LightAccumulationMap", (TriTextureRes*)NULL );
149 //GlobalStore().RegisterVariable( "LightAccumulationSpecularMap", m_lightSpecularRenderPassTexture );
150 GlobalStore().RegisterVariable( "LightPrePassDepthMap", (TriTextureRes*)NULL );
151
152 // Create render batch accumulators
153 TriPoolAllocator* allocator = Tr2Renderer::GetPoolAllocator();
154 m_primaryRenderBatches = CCP_NEW( "Tr2InteriorScene/m_primaryRenderBatches" ) TriRenderBatchAccumulator<Tr2IntKeyGenerator>( allocator );
155 m_opaquePickingBatches = CCP_NEW( "Tr2InteriorScene/m_opaquePickingBatches" ) TriRenderBatchAccumulator<>( allocator );
156 m_pickingBatches = CCP_NEW( "Tr2InteriorScene/m_pickingBatches" ) TriRenderBatchAccumulator<>( allocator );
157
158 // picking
159 m_pickBuffer.PrepareResources();
160 m_pickBuffer.SetClearColor( 0x0 );
161
162 // Variable Handles
163 Vector3 dir( XMVectorMultiply(
164 XMVector3Normalize( m_sunDirection ),
165 XMVectorReplicate( -1.0f ) ) );
166
167 m_sunDirectionVar.Register( "Sun.DirWorld", dir );
168 GlobalStore().RegisterVariable( "PickingComponents", Vector4() );
169
170 m_dynamics.SetNotify( this );

Callers

nothing calls this directly

Calls 7

RegisterVariableMethod · 0.80
PrepareResourcesMethod · 0.80
SetClearColorMethod · 0.80
Vector3Class · 0.50
Vector4Class · 0.50
RegisterMethod · 0.45
GetResourceMethod · 0.45

Tested by

no test coverage detected