Skip to content
This repository was archived by the owner on Jul 3, 2025. It is now read-only.
This repository was archived by the owner on Jul 3, 2025. It is now read-only.

Fix saggy constraints #50

@Nebual

Description

@Nebual

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions