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

Method prepRenderImage

Engine/source/T3D/physics/physicsDebris.cpp:551–589  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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