Skip to content

Ef 18281 brackets too wide - #77

Open
Ikreb1 wants to merge 6 commits into
mainfrom
EF-18281-brackets-too-wide
Open

Ef 18281 brackets too wide#77
Ikreb1 wants to merge 6 commits into
mainfrom
EF-18281-brackets-too-wide

Conversation

@Ikreb1

@Ikreb1 Ikreb1 commented Aug 31, 2026

Copy link
Copy Markdown
Member

https://fenriscreations.atlassian.net/browse/EF-18281
change implementation of boundingbox calculation to use Obb instead of AABB which was not fitting to the boundingbox of the object close enough
image
Cyan: current
Magenta: improved with AABB->obb and corrected per-corner clip w (workaround for a broken carbon-math Transform overload)

Copilot AI lite review requested due to automatic review settings August 31, 2026 11:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Pull request overview

This PR updates Trinity’s bracket projection logic to use oriented bounding boxes (OBBs) instead of axis-aligned bounding boxes (AABBs), aiming to produce tighter on-screen bracket rectangles for rotated/scaled objects. It also adds an optional debug visualization path to render the consumed bounds and the published screen rect.

Changes:

  • Replace AABB-based projection in Tr2ProjectBoundingBoxBracket with OBB corner projection (including near-plane intersection handling).
  • Update the ITr2BoundingBox interface and key implementers to provide GetWorldBoundingObb(Obb&).
  • Add a debugDraw attribute to visualize the OBB wireframe and projected rect via the debug renderer.
File summaries
File Description
trinity/Tr2ProjectBoundingBoxBracket.h Adds m_debugDraw flag for optional debug visualization.
trinity/Tr2ProjectBoundingBoxBracket.cpp Switches projection to OBB-based math; adds debug draw helpers for OBB + rect.
trinity/Tr2ProjectBoundingBoxBracket_Blue.cpp Exposes debugDraw to Blue so it can be toggled at runtime.
trinity/Interior/Tr2IntSkinnedObject.h Adds GetWorldBoundingObb declaration for the bounding interface.
trinity/Interior/Tr2IntSkinnedObject.cpp Implements GetWorldBoundingObb via Obb::CreateClippedWorldBoundingObb.
trinity/Interior/Tr2InteriorPlaceable.h Adds GetWorldBoundingObb declaration for placeables.
trinity/Interior/Tr2InteriorPlaceable.cpp Implements GetWorldBoundingObb for placeables.
trinity/Include/ITr2BoundingBox.h Changes interface from GetWorldBoundingBox(min,max) to GetWorldBoundingObb(obb).
trinity/Eve/SpaceObject/EveSpaceObject2.h Updates interface method to GetWorldBoundingObb.
trinity/Eve/SpaceObject/EveSpaceObject2.cpp Implements GetWorldBoundingObb using local AABB + world transform.
trinity/Eve/EveTransform.h Updates interface method to GetWorldBoundingObb.
trinity/Eve/EveTransform.cpp Implements GetWorldBoundingObb using computed local bounds + world transform.
trinity/Eve/EvePlanet.h Updates interface method to GetWorldBoundingObb.
trinity/Eve/EvePlanet.cpp Implements GetWorldBoundingObb for a spherical planet as an OBB representation.
trinity/Eve/EveEffectRoot2.h Updates interface method to GetWorldBoundingObb.
trinity/Eve/EveEffectRoot2.cpp Implements GetWorldBoundingObb from bounding-sphere data (conservative under non-uniform scale).
Review details
  • Files reviewed: 16/16 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Ikreb1
Ikreb1 marked this pull request as ready for review August 31, 2026 13:02
@Ikreb1
Ikreb1 force-pushed the EF-18281-brackets-too-wide branch from a394cdc to af9ea1f Compare August 31, 2026 13:02

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-linter Review

Used clang-format v21.1.8

Click here for the full clang-format patch
diff --git a/trinity/Tr2ProjectBoundingBoxBracket.cpp b/trinity/Tr2ProjectBoundingBoxBracket.cpp
index aa58d41..ba2daed 100644
--- a/trinity/Tr2ProjectBoundingBoxBracket.cpp
+++ b/trinity/Tr2ProjectBoundingBoxBracket.cpp
@@ -24,3 +24,12 @@ const int OBB_EDGES[12][2] = {
-	{ 0, 1 }, { 2, 3 }, { 4, 5 }, { 6, 7 },
-	{ 0, 2 }, { 1, 3 }, { 4, 6 }, { 5, 7 },
-	{ 0, 4 }, { 1, 5 }, { 2, 6 }, { 3, 7 },
+	{ 0, 1 },
+	{ 2, 3 },
+	{ 4, 5 },
+	{ 6, 7 },
+	{ 0, 2 },
+	{ 1, 3 },
+	{ 4, 6 },
+	{ 5, 7 },
+	{ 0, 4 },
+	{ 1, 5 },
+	{ 2, 6 },
+	{ 3, 7 },

Have any feedback or feature suggestions? Share it here.

Comment thread trinity/Tr2ProjectBoundingBoxBracket.cpp Outdated
@github-actions
github-actions Bot dismissed their stale review August 31, 2026 14:08

outdated suggestion

@Ikreb1
Ikreb1 force-pushed the EF-18281-brackets-too-wide branch from f33021f to e6a8c88 Compare August 31, 2026 16:09
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.

2 participants