mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +00:00
off mesh connection tool
Adds off mesh connection tool upgrade functionality to allow setting the direction to be bi-directional added immediate draw to duDebugDrawtorque so we can draw offmesh connections
This commit is contained in:
parent
de1642c33e
commit
2df2cb5c15
8 changed files with 287 additions and 87 deletions
|
|
@ -323,51 +323,6 @@ void GuiNavEditorCtrl::on3DMouseDown(const Gui3DMouseEvent & event)
|
|||
bool shift = keys & SI_LSHIFT;
|
||||
bool ctrl = keys & SI_LCTRL;
|
||||
|
||||
if(mMode == mLinkMode && !mMesh.isNull())
|
||||
{
|
||||
if(gServerContainer.castRay(startPnt, endPnt, StaticObjectType, &ri))
|
||||
{
|
||||
U32 link = mMesh->getLink(ri.point);
|
||||
if(link != -1)
|
||||
{
|
||||
if(mLink != -1)
|
||||
mMesh->selectLink(mLink, false);
|
||||
mMesh->selectLink(link, true, false);
|
||||
mLink = link;
|
||||
LinkData d = mMesh->getLinkFlags(mLink);
|
||||
Con::executef(this, "onLinkSelected", Con::getIntArg(d.getFlags()));
|
||||
}
|
||||
else
|
||||
{
|
||||
if(mLink != -1)
|
||||
{
|
||||
mMesh->selectLink(mLink, false);
|
||||
mLink = -1;
|
||||
Con::executef(this, "onLinkDeselected");
|
||||
}
|
||||
else
|
||||
{
|
||||
if(mLinkStart != Point3F::Max)
|
||||
{
|
||||
mMesh->addLink(mLinkStart, ri.point);
|
||||
if(!shift)
|
||||
mLinkStart = Point3F::Max;
|
||||
}
|
||||
else
|
||||
{
|
||||
mLinkStart = ri.point;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mMesh->selectLink(mLink, false);
|
||||
mLink = -1;
|
||||
Con::executef(this, "onLinkDeselected");
|
||||
}
|
||||
}
|
||||
|
||||
if(mMode == mTestMode)
|
||||
{
|
||||
// Spawn new character
|
||||
|
|
@ -471,35 +426,6 @@ void GuiNavEditorCtrl::on3DMouseMove(const Gui3DMouseEvent & event)
|
|||
|
||||
RayInfo ri;
|
||||
|
||||
if(mMode == mLinkMode && !mMesh.isNull())
|
||||
{
|
||||
if(gServerContainer.castRay(startPnt, endPnt, StaticObjectType, &ri))
|
||||
{
|
||||
U32 link = mMesh->getLink(ri.point);
|
||||
if(link != -1)
|
||||
{
|
||||
if(link != mLink)
|
||||
{
|
||||
if(mCurLink != -1)
|
||||
mMesh->selectLink(mCurLink, false);
|
||||
mMesh->selectLink(link, true, true);
|
||||
}
|
||||
mCurLink = link;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(mCurLink != mLink)
|
||||
mMesh->selectLink(mCurLink, false);
|
||||
mCurLink = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mMesh->selectLink(mCurLink, false);
|
||||
mCurLink = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if(mMode == mTestMode)
|
||||
{
|
||||
if(gServerContainer.castRay(startPnt, endPnt, PlayerObjectType | VehicleObjectType, &ri))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue