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

Method on3DMouseMove

Engine/source/navigation/guiNavEditorCtrl.cpp:406–461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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