MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / prepRenderImage

Method prepRenderImage

Engine/source/T3D/physics/physicsDebris.cpp:547–585  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

545}
546
547void PhysicsDebris::prepRenderImage( SceneRenderState *state )
548{
549 if( !mShapeInstance )
550 return;
551
552 // Skip shadow rendering if this debris doesn't support it.
553 if ( state->isShadowPass() &&
554 !mDataBlock->castShadows )
555 return;
556
557 // If the debris is completed LOD'd out then skip it.
558 if ( mShapeInstance->setDetailFromPosAndScale( state, getRenderPosition(), getScale() ) < 0 )
559 return;
560
561 // Fade out the debris over the last second of its lifetime.
562 F32 alpha = 1.0;
563 if ( mDataBlock->lifetime > 0.0f )
564 alpha = getMin( mLifetime * smLifetimeScale, 1.0f );
565
566 // Set up our TS render state.
567 TSRenderState rdata;
568 rdata.setSceneState( state );
569 rdata.setFadeOverride( alpha );
570
571 // We might have some forward lit materials
572 // so pass down a query to gather lights.
573 LightQuery query;
574 query.init( getWorldSphere() );
575 rdata.setLightQuery( &query );
576
577 GFXTransformSaver saver;
578
579 MatrixF mat = getRenderTransform();
580 mat.scale( getScale() );
581 GFX->setWorldMatrix( mat );
582
583 mShapeInstance->animate();
584 mShapeInstance->render( rdata );
585}
586
587void PhysicsDebris::applyImpulse( const Point3F &pos, const VectorF &vec )
588{

Callers

nothing calls this directly

Calls 10

isShadowPassMethod · 0.80
setSceneStateMethod · 0.80
setFadeOverrideMethod · 0.80
setLightQueryMethod · 0.80
initMethod · 0.45
scaleMethod · 0.45
setWorldMatrixMethod · 0.45
animateMethod · 0.45
renderMethod · 0.45

Tested by

no test coverage detected