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

Method spawnPlayer

Engine/source/navigation/guiNavEditorCtrl.cpp:214–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

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