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

Method prepRenderImage

Engine/source/T3D/debris.cpp:966–993  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

964}
965
966void Debris::prepRenderImage( SceneRenderState *state )
967{
968 if( !mPart && !mShape )
969 return;
970
971 Point3F cameraOffset;
972 mObjToWorld.getColumn(3,&cameraOffset);
973 cameraOffset -= state->getDiffuseCameraPosition();
974 F32 dist = cameraOffset.len();
975 F32 invScale = (1.0f/getMax(getMax(mObjScale.x,mObjScale.y),mObjScale.z));
976
977 if( mShape )
978 {
979 mShape->setDetailFromDistance( state, dist * invScale );
980 if( mShape->getCurrentDetail() < 0 )
981 return;
982 }
983
984 if( mPart )
985 {
986 // get the shapeInstance that we are using for the debris parts
987 TSShapeInstance *si = mPart->getSourceShapeInstance();
988 if ( si )
989 si->setDetailFromDistance( state, dist * invScale );
990 }
991
992 prepBatchRender( state );
993}
994
995void Debris::prepBatchRender( SceneRenderState *state )
996{

Callers

nothing calls this directly

Calls 7

getMaxFunction · 0.85
getColumnMethod · 0.80
setDetailFromDistanceMethod · 0.80
getCurrentDetailMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected