-
Notifications
You must be signed in to change notification settings - Fork 44
Fix saggy constraints #50
Description
dude advdupe sucks because it makes saggy welds
"Saggy welds are an inevitable problem with how constraints are made. Theres nothing we can do to fix it, though > you'll get much stronger welds if you freeze your props before duping them"
ya but advdupe2 can do it
"grumbles and leaves"
-- Me, versus the unwashed masses
Okay, so advdupe2's solution was to hook into OnEntityCreated, and save the local positions of all physics objects involved in the constraint into the constraint itself. When pasting, it simply moves the physics objects to their original locations when the constraint was first made, pastes the constraint, then moves them back. It may seem a bit hacky, and its not 100% effective in all cases, but its a whole lot better than what we do now with regards to constraints.
I don't know if TB can copyright the basic idea of the above paragraph, as obviously copypasting his exact code isn't applicable, but we need to do something like it.
Advdupe2:
Save initial constraint positions line 18
Hook into OnEntityCreated to call the above function line 72
Inside PasteConstraint, before running the factory function, move ents into place line 519
Inside PasteConstraint, after running factory function line 569