MCPcopy Create free account
hub / github.com/OGRECave/ogre-next / _sortParticles

Method _sortParticles

OgreMain/src/OgreParticleSystem.cpp:1202–1228  ·  view source on GitHub ↗

-----------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1200 }
1201 //-----------------------------------------------------------------------
1202 void ParticleSystem::_sortParticles( Camera *cam )
1203 {
1204 if( mRenderer )
1205 {
1206 SortMode sortMode = mRenderer->_getSortMode();
1207 if( sortMode == SM_DIRECTION )
1208 {
1209 Vector3 camDir = cam->getDerivedDirection();
1210 if( mLocalSpace )
1211 {
1212 // transform the camera direction into local space
1213 camDir = mParentNode->convertWorldToLocalDirection( camDir, false );
1214 }
1215 mRadixSorter.sort( mActiveParticles, SortByDirectionFunctor( -camDir ) );
1216 }
1217 else if( sortMode == SM_DISTANCE )
1218 {
1219 Vector3 camPos = cam->getDerivedPosition();
1220 if( mLocalSpace )
1221 {
1222 // transform the camera position into local space
1223 camPos = mParentNode->convertWorldToLocalPosition( camPos );
1224 }
1225 mRadixSorter.sort( mActiveParticles, SortByDistanceFunctor( camPos ) );
1226 }
1227 }
1228 }
1229 ParticleSystem::SortByDirectionFunctor::SortByDirectionFunctor( const Vector3 &dir ) : sortDir( dir )
1230 {
1231 }

Callers

nothing calls this directly

Calls 7

_getSortModeMethod · 0.45
getDerivedDirectionMethod · 0.45
sortMethod · 0.45

Tested by

no test coverage detected