Skip to content

fix: OBB-aware volume trigger overlap for rotation and scale - #3321

Open
chenlinxi890-spec wants to merge 1 commit into
armory3d:mainfrom
chenlinxi890-spec:fix/volume-trigger-rotation-scale-2595
Open

fix: OBB-aware volume trigger overlap for rotation and scale#3321
chenlinxi890-spec wants to merge 1 commit into
armory3d:mainfrom
chenlinxi890-spec:fix/volume-trigger-rotation-scale-2595

Conversation

@chenlinxi890-spec

Copy link
Copy Markdown

What changed:

  • Added \TransformExtension.overlap_obb()\ using SAT (Separating Axis Theorem) for rotation+scale-aware bounding box overlap
  • \OnVolumeTriggerNode.hx: replaced AABB-only overlap with \TransformExtension.overlap_obb()\
  • \VolumeTriggerNode.hx: replaced \ 1.overlap(t2)\ with \TransformExtension.overlap_obb()\
  • Original \TransformExtension.overlap()\ preserved for backward compatibility

Why:

Issue #2595 reported that the On Volume Trigger only uses extents without accounting for rotation and scale. When a volume trigger is rotated or scaled, overlap detection produces incorrect results. The new \overlap_obb()\ method transforms half-extents by world-space basis vectors (right/up/look) and applies SAT across all 15 separating axes.

Validation:

  • Minimal targeted change: only 3 files in \�rmory/Sources/armory/\
  • Original \overlap()\ method unchanged; \overlap_obb()\ is additive
  • No new dependencies; uses existing \iron.math.Vec4\ and \Mat4\ APIs

Risk:

Low. Purely additive change. Existing \overlap()\ behavior preserved. New \overlap_obb()\ only used by volume trigger nodes.

- Add TransformExtension.overlap_obb() using SAT (Separating Axis Theorem)
  to account for rotation and scale of both objects
- Replace AABB-only overlap in OnVolumeTriggerNode.hx with overlap_obb()
- Replace AABB-only overlap in VolumeTriggerNode.hx with overlap_obb()
- Minimal targeted change: only physics logic node overlap detection
- Backward compatible: original overlap() preserved, new method additive

Fixes: On Volume Trigger should take its rotation and scale into account (armory3d#2595)
@chenlinxi890-spec

Copy link
Copy Markdown
Author

Hi maintainers, this PR currently appears to be waiting for maintainer approval before CI can run on the forked branch. Could you please approve the workflow run when you have time? I'm happy to address any issues if the checks fail. Thanks!

@chenlinxi890-spec

Copy link
Copy Markdown
Author

Payout asset: USDC
Payout network: Base
Payout address: 0x9d4cc3466a2d81efb8b575e2af154ce81cae2a46

@chenlinxi890-spec

Copy link
Copy Markdown
Author

Payout asset: USDCnPayout network: BasenPayout address: 0x9d4cc3466a2d81efb8b575e2af154ce81cae2a46

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant