When using the gizmo to translate a model with lots of connections, the movement wouldn't draw to the panel until letting go of the mouse (or waiting a period of time without movement). This is due to WinForms delaying the paint event until it's not busy, and it was always busy because FixConnections was causing enough lag to keep it occuppied. One solution could have been to call _openTkControl.Refresh() during the gizmo mover updates, but that's a drastic approach, when trying to speed things up would be better approach. Additionally the Refresh solution wouldn't fix other controls, like the property grid not updating.
FixConnections now caches found connections in Triangle, when calling FixConnections again, cached connections will be used so that we don't need to look through up to N^N triangle vertices each call. This speed-up is enough to allow Paint to be called for the render during gizmo translation. It also drastically speeds up animating models with attached limbs (such as PsyQ's YESNO5.HMD).
Added ClearConnectionsCache to EntityBase, so that cached connections can be reset if changes have been made that would change the initial vertices and attached entities.
ModelEntity now calls base.FixConnections.
Switched all uses of GeomUtils.(XYZ)Vector to Vector3.Unit(XYZ), since it's already provided for us.
Commented out GeomUtils.VecDistance and left a note to use Vector3.Distance instead. This function was unused.
When using the gizmo to translate a model with lots of connections, the movement wouldn't draw to the panel until letting go of the mouse (or waiting a period of time without movement). This is due to WinForms delaying the paint event until it's not busy, and it was always busy because FixConnections was causing enough lag to keep it occuppied. One solution could have been to call
_openTkControl.Refresh()
during the gizmo mover updates, but that's a drastic approach, when trying to speed things up would be better approach. Additionally the Refresh solution wouldn't fix other controls, like the property grid not updating.N^N
triangle vertices each call. This speed-up is enough to allow Paint to be called for the render during gizmo translation. It also drastically speeds up animating models with attached limbs (such as PsyQ'sYESNO5.HMD
).GeomUtils.(XYZ)Vector
toVector3.Unit(XYZ)
, since it's already provided for us.GeomUtils.VecDistance
and left a note to useVector3.Distance
instead. This function was unused.