MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / setControllingClient

Method setControllingClient

Engine/source/T3D/shapeBase.cpp:1404–1433  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1402}
1403
1404void ShapeBase::setControllingClient( GameConnection* client )
1405{
1406 if( isGhost() && gSFX3DWorld )
1407 {
1408 if( gSFX3DWorld->getListener() == this && !client && getControllingClient() && getControllingClient()->isConnectionToServer() )
1409 {
1410 // We are the current listener and are no longer a controller object on the
1411 // connection, so clear our listener status.
1412
1413 gSFX3DWorld->setListener( NULL );
1414 }
1415 else if( client && client->isConnectionToServer() && !getControllingObject() )
1416 {
1417 // We're on the local client and not controlled by another object, so make
1418 // us the current SFX listener.
1419
1420 gSFX3DWorld->setListener( this );
1421 }
1422 }
1423
1424 Parent::setControllingClient( client );
1425
1426 // Update all of the mounted images' shapes so they may
1427 // optimize their animation threads.
1428 for (U32 i=0; i<MaxMountedImages; ++i)
1429 {
1430 MountedImage& image = mMountedImageList[i];
1431 image.updateDoAnimateAllShapes( this );
1432 }
1433}
1434
1435void ShapeBase::setControllingObject(ShapeBase* obj)
1436{

Callers

nothing calls this directly

Calls 4

getListenerMethod · 0.80
isConnectionToServerMethod · 0.80
setListenerMethod · 0.45

Tested by

no test coverage detected