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

Method on3DMouseUp

Engine/source/gui/worldEditor/worldEditor.cpp:2078–2240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2076}
2077
2078void WorldEditor::on3DMouseUp( const Gui3DMouseEvent &event )
2079{
2080 //If we have an active tool and it's intercepted our input, bail out
2081 if (mActiveEditorTool != nullptr && mActiveEditorTool->onMouseUp(event))
2082 return;
2083
2084 const bool wasUsingAxisGizmo = mUsingAxisGizmo;
2085
2086 mMouseDown = false;
2087 mStuckToGround = false;
2088 mSoftSnapIsStuck = false;
2089 mSoftSnapActivated = false;
2090 mUsingAxisGizmo = false;
2091 mGizmo->on3DMouseUp(event);
2092
2093 // Restore grid snap if we temporarily toggled it.
2094
2095 if( mDragGridSnapToggle )
2096 {
2097 mDragGridSnapToggle = false;
2098 const bool snapToGrid = !mGridSnap;
2099 mGridSnap = snapToGrid;
2100 mGizmo->getProfile()->snapToGrid = snapToGrid;
2101 }
2102
2103 // check if selecting objects....
2104 if ( mDragSelect )
2105 {
2106 mDragSelect = false;
2107 mPossibleHitObject = NULL;
2108
2109 const bool addToSelection = ( event.modifier & ( SI_RANGESELECT | SI_MULTISELECT ) );
2110
2111 // add all the objects from the drag selection into the normal selection
2112 if( !addToSelection )
2113 clearSelection();
2114
2115 if ( mDragSelected->size() > 1 )
2116 {
2117 for ( U32 i = 0; i < mDragSelected->size(); i++ )
2118 mSelected->addObject( ( *mDragSelected )[i] );
2119
2120 Con::executef( this, "onMultiSelect", mDragSelected->getIdString(), addToSelection ? "1" : "0" );
2121 mDragSelected->clear();
2122
2123 SimObject *obj = NULL;
2124 if ( mRedirectID )
2125 obj = Sim::findObject( mRedirectID );
2126 Con::executef( obj ? obj : this, "onClick", ( *mSelected )[ 0 ]->getIdString() );
2127 }
2128 else if ( mDragSelected->size() == 1 )
2129 {
2130 mSelected->addObject( ( *mDragSelected )[0] );
2131 Con::executef( this, "onSelect", ( *mDragSelected )[ 0 ]->getIdString() );
2132 mDragSelected->clear();
2133
2134 SimObject *obj = NULL;
2135 if ( mRedirectID )

Callers

nothing calls this directly

Calls 13

executefFunction · 0.85
dSprintfFunction · 0.85
getIdStringMethod · 0.80
objInSetMethod · 0.80
getIdMethod · 0.65
findObjectFunction · 0.50
onMouseUpMethod · 0.45
getProfileMethod · 0.45
sizeMethod · 0.45
addObjectMethod · 0.45
clearMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected