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

Method setDetailFromPosAndScale

Engine/source/ts/tsShapeInstance.cpp:615–624  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

613}
614
615S32 TSShapeInstance::setDetailFromPosAndScale( const SceneRenderState *state,
616 const Point3F &pos,
617 const Point3F &scale )
618{
619 VectorF camVector = pos - state->getDiffuseCameraPosition();
620 F32 dist = getMax( camVector.len(), 0.01f );
621 F32 invScale = ( 1.0f / getMax( getMax( scale.x, scale.y ), scale.z ) );
622
623 return setDetailFromDistance( state, dist * invScale );
624}
625
626S32 TSShapeInstance::setDetailFromDistance( const SceneRenderState *state, F32 scaledDistance )
627{

Callers 3

prepBatchRenderMethod · 0.80
prepBatchRenderMethod · 0.80
prepRenderImageMethod · 0.80

Calls 3

getMaxFunction · 0.85
lenMethod · 0.45

Tested by

no test coverage detected