Skip to content

Fixture not created on hit box change #1438

@AlmasB

Description

@AlmasB

Discussed in #1437

Originally posted by LifeDrainingCoding September 24, 2025
I'm struggling to change hitboxes after collision events. So here's the example:

public void updateBody() {
        ((Circle) view.getChildren().getLast()).setRadius(radius.get());
        bbox.clearHitBoxes();
        hitBox =  new HitBox(new Point2D(-radius.get(), -radius.get()),BoundingShape.circle(radius.get()));
        bbox.addHitBox(hitBox);
    }

so view is link of ViewComponent obtained by Entity.getViewComponent() and bbox is link of BoundingBoxComponent obtained by Entity.getBoundingBoxComponent().

So, after changing hitboxes in bounding box component like in example it doesn't changes at all. Even if bboxes is highlighted by debug menu this lines are doesnt match actual bbox. As you can see in screenshot below blue lines is border bounding boxes they clipping through other bounding while shouldn't and these circles aren't stuck and can freely move by just applying some forces. So these circles doesn't changed their bounding boxes after their spawn in the world(While should, but only visually changed). So it can be proved that i saw collisions while it shouldn't be.
image

The full app code here

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugDoesn't behave according to specification

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions