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

Method onAdd

Engine/source/navigation/navMesh.cpp:347–377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

345}
346
347bool NavMesh::onAdd()
348{
349 if(!Parent::onAdd())
350 return false;
351
352 mObjBox.set(Point3F(-0.5f, -0.5f, -0.5f),
353 Point3F( 0.5f, 0.5f, 0.5f));
354 resetWorldBox();
355
356 addToScene();
357
358 if(gEditingMission || mAlwaysRender)
359 {
360 mNetFlags.set(Ghostable);
361 if(isClientObject())
362 renderToDrawer();
363 }
364
365 if(isServerObject())
366 {
367 getServerSet()->addObject(this);
368 ctx = new NavContext();
369 setProcessTick(true);
370 if(getEventManager())
371 getEventManager()->postEvent("NavMeshCreated", getIdString());
372 }
373
374 load();
375
376 return true;
377}
378
379void NavMesh::onRemove()
380{

Callers

nothing calls this directly

Calls 5

loadFunction · 0.85
Point3FClass · 0.50
setMethod · 0.45
addObjectMethod · 0.45
postEventMethod · 0.45

Tested by

no test coverage detected