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

Method spawnPlayer

Engine/source/navigation/guiNavEditorCtrl.cpp:212–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210}
211
212void GuiNavEditorCtrl::spawnPlayer(const Point3F &pos)
213{
214 SceneObject *obj = (SceneObject*)Sim::spawnObject(mSpawnClass, mSpawnDatablock);
215 if(obj)
216 {
217 MatrixF mat(true);
218 mat.setPosition(pos);
219 obj->setTransform(mat);
220 SimObject* cleanup = Sim::findObject("MissionCleanup");
221 if(cleanup)
222 {
223 SimGroup* missionCleanup = dynamic_cast<SimGroup*>(cleanup);
224 missionCleanup->addObject(obj);
225 }
226 mPlayer = static_cast<AIPlayer*>(obj);
227 Con::executef(this, "onPlayerSelected", Con::getIntArg(mPlayer->mLinkTypes.getFlags()));
228 }
229}
230
231DefineEngineMethod(GuiNavEditorCtrl, spawnPlayer, void, (),,
232 "@brief Spawn an AIPlayer at the centre of the screen.")

Callers 6

ObserverFunction · 0.80
GameConnectionFunction · 0.80
gameCore.csFile · 0.80
ObserverFunction · 0.80
GameConnectionFunction · 0.80

Calls 8

spawnObjectFunction · 0.85
executefFunction · 0.85
getIntArgFunction · 0.85
findObjectFunction · 0.50
setPositionMethod · 0.45
setTransformMethod · 0.45
addObjectMethod · 0.45
getFlagsMethod · 0.45

Tested by

no test coverage detected