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

Method setControlObject

Engine/source/T3D/player.cpp:1990–2011  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1988}
1989
1990void Player::setControlObject(ShapeBase* obj)
1991{
1992 if (mControlObject == obj)
1993 return;
1994
1995 if (mControlObject) {
1996 mControlObject->setControllingObject(0);
1997 mControlObject->setControllingClient(0);
1998 }
1999 if (obj == this || obj == 0)
2000 mControlObject = 0;
2001 else {
2002 if (ShapeBase* coo = obj->getControllingObject())
2003 coo->setControlObject(0);
2004 if (GameConnection* con = obj->getControllingClient())
2005 con->setControlObject(0);
2006
2007 mControlObject = obj;
2008 mControlObject->setControllingObject(this);
2009 mControlObject->setControllingClient(getControllingClient());
2010 }
2011}
2012
2013void Player::onCameraScopeQuery(NetConnection *connection, CameraScopeQuery *query)
2014{

Calls 4

setControllingObjectMethod · 0.80
setControllingClientMethod · 0.45
getControllingObjectMethod · 0.45
getControllingClientMethod · 0.45

Tested by

no test coverage detected