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

Method on3DMouseMove

Engine/source/navigation/guiNavEditorCtrl.cpp:408–463  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

406}
407
408void GuiNavEditorCtrl::on3DMouseMove(const Gui3DMouseEvent & event)
409{
410 //if(mSelRiver != NULL && mSelNode != -1)
411 //mGizmo->on3DMouseMove(event);
412
413 Point3F startPnt = event.pos;
414 Point3F endPnt = event.pos + event.vec * 1000.0f;
415
416 RayInfo ri;
417
418 if(mMode == mLinkMode && !mMesh.isNull())
419 {
420 if(gServerContainer.castRay(startPnt, endPnt, StaticObjectType, &ri))
421 {
422 U32 link = mMesh->getLink(ri.point);
423 if(link != -1)
424 {
425 if(link != mLink)
426 {
427 if(mCurLink != -1)
428 mMesh->selectLink(mCurLink, false);
429 mMesh->selectLink(link, true, true);
430 }
431 mCurLink = link;
432 }
433 else
434 {
435 if(mCurLink != mLink)
436 mMesh->selectLink(mCurLink, false);
437 mCurLink = -1;
438 }
439 }
440 else
441 {
442 mMesh->selectLink(mCurLink, false);
443 mCurLink = -1;
444 }
445 }
446
447 // Select a tile from our current NavMesh.
448 if(mMode == mTileMode && !mMesh.isNull())
449 {
450 if(gServerContainer.castRay(startPnt, endPnt, StaticObjectType, &ri))
451 mCurTile = mMesh->getTile(ri.point);
452 else
453 mCurTile = -1;
454 }
455
456 if(mMode == mTestMode)
457 {
458 if(gServerContainer.castRay(startPnt, endPnt, PlayerObjectType, &ri))
459 mCurPlayer = dynamic_cast<AIPlayer*>(ri.object);
460 else
461 mCurPlayer = NULL;
462 }
463}
464
465void GuiNavEditorCtrl::on3DMouseDragged(const Gui3DMouseEvent & event)

Callers

nothing calls this directly

Calls 5

getLinkMethod · 0.80
selectLinkMethod · 0.80
isNullMethod · 0.45
castRayMethod · 0.45
getTileMethod · 0.45

Tested by

no test coverage detected