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

Method setControllingClient

Engine/source/T3D/shapeBase.cpp:1543–1572  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1541}
1542
1543void ShapeBase::setControllingClient( GameConnection* client )
1544{
1545 if( isGhost() && gSFX3DWorld )
1546 {
1547 if( gSFX3DWorld->getListener() == this && !client && getControllingClient() && getControllingClient()->isConnectionToServer() )
1548 {
1549 // We are the current listener and are no longer a controller object on the
1550 // connection, so clear our listener status.
1551
1552 gSFX3DWorld->setListener( NULL );
1553 }
1554 else if( client && client->isConnectionToServer() && (getControllingObject() != this) )
1555 {
1556 // We're on the local client and not controlled by another object, so make
1557 // us the current SFX listener.
1558
1559 gSFX3DWorld->setListener( this );
1560 }
1561 }
1562
1563 Parent::setControllingClient( client );
1564
1565 // Update all of the mounted images' shapes so they may
1566 // optimize their animation threads.
1567 for (U32 i=0; i<MaxMountedImages; ++i)
1568 {
1569 MountedImage& image = mMountedImageList[i];
1570 image.updateDoAnimateAllShapes( this );
1571 }
1572}
1573
1574void ShapeBase::setControllingObject(ShapeBase* obj)
1575{

Callers

nothing calls this directly

Calls 4

getListenerMethod · 0.80
isConnectionToServerMethod · 0.80
setListenerMethod · 0.45

Tested by

no test coverage detected