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

Method _renderObject

Engine/source/T3D/sfx/sfxEmitter.cpp:830–865  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

828//-----------------------------------------------------------------------------
829
830void SFXEmitter::_renderObject( ObjectRenderInst* ri, SceneRenderState* state, BaseMatInstance* overrideMat )
831{
832 // Check to see if the emitter is in range and playing
833 // and assign a proper color depending on this.
834
835 ColorI color;
836 if( _getPlaybackStatus() == SFXStatusPlaying )
837 {
838 if( isInRange() )
839 color = smRenderColorPlayingInRange;
840 else
841 color = smRenderColorPlayingOutOfRange;
842 }
843 else
844 {
845 if( isInRange() )
846 color = smRenderColorStoppedInRange;
847 else
848 color = smRenderColorStoppedOutOfRange;
849 }
850
851 // Draw the cube.
852
853 GFXStateBlockDesc desc;
854 desc.setZReadWrite( true, false );
855 desc.setBlend( true );
856 desc.setCullMode( GFXCullNone );
857
858 GFXDrawUtil *drawer = GFX->getDrawUtil();
859 drawer->drawCube( desc, Point3F( 0.5f, 0.5f, 0.5f ), getBoxCenter(), color );
860
861 // Render visual feedback for 3D sounds.
862
863 if( ( smRenderEmitters || isSelected() ) && is3D() )
864 _render3DVisualFeedback();
865}
866
867//-----------------------------------------------------------------------------
868

Callers

nothing calls this directly

Calls 7

isSelectedFunction · 0.85
setZReadWriteMethod · 0.80
setBlendMethod · 0.80
setCullModeMethod · 0.80
getDrawUtilMethod · 0.80
drawCubeMethod · 0.80
Point3FClass · 0.50

Tested by

no test coverage detected