#ttp 345297 - NUX: Improve workflow for SME collision editing
#branch UE4
#change Modified Collision options to say 'Add' to indicate you're adding primitives and not replacing existing.
#change When adding a new collision primitive, it now does a quick check to see if there's another primitive that's the same and if so, moves the new one slightly so they don't overlap - the hope is that this also makes it clearer that you're adding primitives.
Note: Also includes change from 2280280 which enables Show Collision if it's modified
reviewed by Thomas.Sarkanen
[CL 2299231 by Andrew Brown in Main branch]
#ttp 334968 - TOOLS FEATURE: Add primitive collision inside the static mesh editor
#branch UE4
#change
GenerateSimpleCollision funcs now return true if any collision was built
Moved Prompt to build collision into a func (to remove duplicate code), and modified so that the options are Yes=Replace, No=Add-To, Cancel = Cancel.
Added CalcBoundingSphyl code which is loosely based on the Sphere code in that it finds the best axis to align the sphyl with (but locally rotates so it can treat the Z axis as length, regardless). It they finds the radius to best enclose the Sphyl (same as Sphere, but 2D). Then it increase the length of the Sphyl until that encapsulates all the remaining points.
Replace instances of AddZeroed with Add(FKTypeElem()) so that the vtable would be created correctly if a base struct was introduced.
Moved PhysX code which scales the Elems from ModifyPrimitiveSize to their own struct func (ScaleElem) so that it could be used elsewhere.
Added new struct FPrimData which contains the PrimType and PrimIndex so we can look the corresponding collision Elem up in our BodySetup. The static mesh editor session which is open for a particular static mesh keeps track of these using the following:
IsPrimValid û Checks to see if the prim data could be valid
HasSelectedPrims û Returns true if there are any selected prims
IsSelectedPrim û Check to see if the prim data is selected
AddSelectedPrim û Adds prim data to our selection
RemoveSelectedPrim û Removes prim data from our selection
RemoveInvalidPrism - Removes any prims which are no longer valid from the selection
ClearSelectedPrims û Removes all the prim data from our selection
DuplicateSelectedPrims û Duplicates the selected prims
TranslateSelectedPrims - Translates the selected prims by a specified amount
RotateSelectedPrims - Rotates the selected prims by a specified amount
ScaleSelectedPrims - Scales the selected prims by a specified amount
CalcSelectedPrimsAABB - Calculates the bounding box of the selected prims
DeleteSelectedPrims û Deletes the selected prims
GetLastSelectedPrimTransform û Gets the transform of the last prim which was added to the selection.
GetPrimTransform - Gets the transform of a specified prim
SetPrimTransform - Sets the transform of a specified prim
Added placeholder calls to begin/end transaction where itÆs needed whenever the bodysetup prims are modified.
Added new Static Mesh Editor menu option to create a capsule/sphyl
Added dedicated collision toggle flag to the Static Mesh Editor so we could manage our own handling of the draw functions in order to inject hit proxies where needed so we can test when theyÆve been clicked on in the viewport.
Widget now works when selecting collision Elems. Space toggles the manipulation method.
SelectedPrims can be trans/rot/scaled using the editor widget.
Prims can be duplicated or deleted either using menu entries or keyboard shortcuts. Alt+drag is also supported for duplication.
ProcessClick was updated so that whenever a new selection type is clicked on the previous types are deselected (sockets, prims, edges), and other code location were updated to clear the selected prims where appropriate.
Modified OnFocusViewportToSelection so that it also focuses on the selected elems too
Modified SetSelectedSocket so that when passing NULL it deselects all the sockets
[CL 2104326 by Andrew Brown in Main branch]