MCPcopy Create free account
hub / github.com/carbonengine/trinity / GetLocatorTransform

Method GetLocatorTransform

trinity/Eve/SpaceObject/EveSpaceObject2.cpp:1287–1332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1285}
1286
1287const Matrix* EveSpaceObject2::GetLocatorTransform( LocatorType lt, unsigned int lix )
1288{
1289 switch( lt )
1290 {
1291 case ELT_TRANSFORM: {
1292 EveLocator2* t = m_locators[lix];
1293 return &t->GetTransform();
1294 }
1295 break;
1296
1297 case ELT_JOINT: {
1298 if( !m_animationUpdater )
1299 {
1300 return nullptr;
1301 }
1302
1303 if( m_animationUpdater->IsUsingCMF() )
1304 {
1305 auto& worldTransforms = m_animationUpdater->GetWorldTransforms();
1306 if( !worldTransforms.size() )
1307 {
1308 return nullptr;
1309 }
1310 if( lix >= worldTransforms.size() )
1311 {
1312 return nullptr;
1313 }
1314 return &worldTransforms[lix];
1315 }
1316#if WITH_GRANNY
1317 else
1318 {
1319 if( !m_animationUpdater->m_worldPose )
1320 {
1321 return nullptr;
1322 }
1323
1324 return reinterpret_cast<const Matrix*>( GrannyGetWorldPose4x4( m_animationUpdater->m_worldPose, lix ) );
1325 }
1326#else
1327 else
1328 {
1329 return nullptr;
1330 }
1331#endif
1332 }
1333 break;
1334
1335 default:

Callers

nothing calls this directly

Calls 4

sizeMethod · 0.80
ifFunction · 0.50
GetTransformMethod · 0.45
IsUsingCMFMethod · 0.45

Tested by

no test coverage detected