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

Method IsCastingShadow

trinity/Eve/SpaceObject/EveSwarm.cpp:242–267  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////////////////// IEveShadowCaster

Source from the content-addressed store, hash-verified

240//////////////////////////////////////////////////////////////////////////////////////
241// IEveShadowCaster
242bool EveSwarmRenderable::IsCastingShadow( const TriFrustum& cameraFrustum, const IEveShadowFrustum& shadowFrustum, Tr2RenderReason renderReason, float& sizeInShadow ) const
243{
244 Vector4 boundingSphere;
245 if( !m_owner )
246 {
247 return false;
248 }
249
250 if( renderReason == TR2RENDERREASON_REFLECTION )
251 {
252 return false;
253 }
254
255 if( m_owner->GetBoundingSphere( boundingSphere ) )
256 {
257 boundingSphere.GetXYZ() = m_worldTransform.GetTranslation();
258 sizeInShadow = 0;
259
260 if( shadowFrustum.IsVisible( cameraFrustum, boundingSphere ) )
261 {
262 sizeInShadow = shadowFrustum.GetSizeInShadow( boundingSphere );
263 }
264 return sizeInShadow > 15.f;
265 }
266 return false;
267}
268
269void EveSwarmRenderable::GetShadowBatches( ITriRenderBatchAccumulator* batches, const Tr2PerObjectData* perObjectData, float shadowPixelSize )
270{

Callers

nothing calls this directly

Calls 4

GetTranslationMethod · 0.80
GetBoundingSphereMethod · 0.45
IsVisibleMethod · 0.45
GetSizeInShadowMethod · 0.45

Tested by

no test coverage detected