Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.
This repository was archived by the owner on May 15, 2026. It is now read-only.

brush-entities are ignoring the "origin" property #94

Description

@Skaruts

Brush-entities ignore the origin property and always end up positioned at the center of their geometry, making it impossible to make rotating entities with TBLoader (doors, levers, fans, etc).

It would be nice if one could define the point of rotation, by defining the origin property in TB.

(TB doesn't currently have a good way to edit origins, but one can use a dummy point-entity, and copy-paste the origin value to the brush-entity.)


I tackled this in my fork and I found a possible fix. I found that libmap itself seems to create brush geometry relative to the entity's center or something, so fixing this at a core level might be tricky. Also because changing that code will also affect world geometry.

So the way I fixed it is perhaps a little hacky, but seems to work fine. Basically it's just two steps:

  • don't position the node at ent.center if it has an origin property
  • if it has origin, then adjust the position of its children (ent.center - origin)
(Ignore the switch-case changes at the bottom of that commit, as they're irrelevant to the issue. That was just my OCD being triggered by unindented cases.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions