Skip to content

Rework bounding box bracket projection and implement ITr2BoundingBox on more space objects#9

Open
Ikreb1 wants to merge 18 commits into
mainfrom
bugfix/BoundingBoxBracket-iteration
Open

Rework bounding box bracket projection and implement ITr2BoundingBox on more space objects#9
Ikreb1 wants to merge 18 commits into
mainfrom
bugfix/BoundingBoxBracket-iteration

Conversation

@Ikreb1

@Ikreb1 Ikreb1 commented Jun 26, 2026

Copy link
Copy Markdown
Member

Bounding-box bracket projection rework

https://fenriscreations.atlassian.net/browse/PLAT-11557

Summary

Rewrites Tr2ProjectBoundingBoxBracket from screen-space clamping to clip-space projection with proper near-plane clipping, fixing brackets vanishing when the tracked object's bounds cross the near plane. Also:

  • Adds projection-state outputs (extendsOffscreen, coversViewport, containsCamera), reusing the EveProjectBracket convention).
  • Implements ITr2BoundingBox on EveTransform, EvePlanet, EveEffectRoot2 (Blue-exposed, plus EveRootTransform) so more scene objects can be bracket-tracked.
  • Tr2InteriorPlaceable::IsBoundingBoxReady() accounts for modified bounds.
  • EveTransform::GetLocalToWorldTransform now returns m_worldTransform instead of identity.

Backwards incompatibility with EVE Online?

This might change the behavior in eve but I think not since my changes are behind flags and here is the only instance it is used:

  • eve/client/script/ui/login/charcreation_new/.../dollSelectionContainer.py: the character-creation doll-selection screen subclasses it with default_screenMargin = 10.0.
    EDIT: eve apparently added a second use case and I need to review if my changes affect that one

Comment thread trinity/Eve/EveTransform.cpp Outdated
Comment thread trinity/Eve/EveTransform.cpp
Comment thread trinity/Eve/EveTransform.cpp Outdated
Comment thread trinity/Tr2ProjectBoundingBoxBracket_Blue.cpp Outdated
Comment thread trinity/Tr2ProjectBoundingBoxBracket.cpp
Comment thread trinity/Eve/EveEffectRoot2.cpp Outdated
Comment thread trinity/Tr2ProjectBoundingBoxBracket.cpp Outdated
Comment thread trinity/Eve/EveEffectRoot2.cpp Outdated
Comment thread trinity/Eve/EveTransform.h Outdated
# Conflicts:
#	trinity/Eve/EveEffectRoot2.cpp
#	trinity/Eve/EvePlanet_Blue.cpp
#	trinity/Eve/EveTransform.h
#	trinity/Interior/Tr2InteriorPlaceable.cpp
#	trinity/Tr2ProjectBoundingBoxBracket.cpp
#	trinity/Tr2ProjectBoundingBoxBracket_Blue.cpp
Copilot AI review requested due to automatic review settings July 14, 2026 14:11

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.

Pull request overview

This PR improves bracket projection robustness by replacing the previous screen-space clamping approach with a clip-space based bounding-box projection (including near-plane handling), and expands bounding-box support across several Eve/Interior objects via ITr2BoundingBox so they can participate in bracket-style tracking.

Changes:

  • Reworked Tr2ProjectBoundingBoxBracket projection to compute a projected rect from clip-space points and added projection state outputs + an update callback.
  • Implemented/exposed ITr2BoundingBox on additional scene objects (EveTransform, EvePlanet, EveEffectRoot2) and surfaced the interface to Blue.
  • Adjusted Tr2InteriorPlaceable::IsBoundingBoxReady() to account for modified bounds.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
trinity/Tr2ProjectBoundingBoxBracket.h Adds projection state flags and a Blue callback; adds UpdateBracket() helper.
trinity/Tr2ProjectBoundingBoxBracket.cpp Replaces projection logic with clip-space projection + near-plane intersection handling; centralizes bracket updates and invokes callback.
trinity/Tr2ProjectBoundingBoxBracket_Blue.cpp Updates Blue exposure, deprecates screenMargin, exposes new projection state flags and callback.
trinity/Interior/Tr2InteriorPlaceable.cpp Treats locally-modified bounding boxes as “ready” even if resources aren’t.
trinity/Eve/EveTransform.h Makes EveTransform implement ITr2BoundingBox; fixes local-to-world transform to use m_worldTransform.
trinity/Eve/EveTransform.cpp Implements local/world bounding box aggregation (including children) and readiness checks.
trinity/Eve/EveTransform_Blue.cpp Exposes ITr2BoundingBox to Blue for EveTransform.
trinity/Eve/EveRootTransform_Blue.cpp Exposes ITr2BoundingBox to Blue for EveRootTransform (via inheritance).
trinity/Eve/EvePlanet.h Declares ITr2BoundingBox support for EvePlanet.
trinity/Eve/EvePlanet.cpp Implements GetWorldBoundingBox()/IsBoundingBoxReady() for EvePlanet.
trinity/Eve/EvePlanet_Blue.cpp Exposes ITr2BoundingBox to Blue for EvePlanet.
trinity/Eve/EveEffectRoot2.h Declares ITr2BoundingBox support for EveEffectRoot2.
trinity/Eve/EveEffectRoot2.cpp Implements world bounding box aggregation using root + child bounding spheres with validation.
trinity/Eve/EveEffectRoot2_Blue.cpp Exposes ITr2BoundingBox to Blue for EveEffectRoot2.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread trinity/Tr2ProjectBoundingBoxBracket.cpp Outdated
Comment thread trinity/Tr2ProjectBoundingBoxBracket.cpp
Comment thread trinity/Eve/EveTransform.h
@Ikreb1
Ikreb1 marked this pull request as ready for review July 17, 2026 13:40

@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 v20.1.2

Click here for the full clang-format patch
diff --git a/trinity/Eve/EveEffectRoot2.h b/trinity/Eve/EveEffectRoot2.h
index d9c6003..ff0cd82 100644
--- a/trinity/Eve/EveEffectRoot2.h
+++ b/trinity/Eve/EveEffectRoot2.h
@@ -95 +95 @@ public:
-	bool GetWorldBoundingBox( Vector3& min, Vector3& max ) const override;
+	bool GetWorldBoundingBox( Vector3 & min, Vector3 & max ) const override;

Have any feedback or feature suggestions? Share it here.

Comment thread trinity/Eve/EveEffectRoot2.h Outdated
@carbonengine carbonengine deleted a comment from ccpgames-carbon Jul 20, 2026
@carbonengine carbonengine deleted a comment from ccpgames-carbon Jul 20, 2026
Comment thread trinity/Tr2ProjectBoundingBoxBracket.cpp Outdated
Comment thread trinity/Tr2ProjectBoundingBoxBracket.cpp Outdated
Comment thread trinity/Tr2ProjectBoundingBoxBracket.cpp Outdated
Comment thread trinity/Tr2ProjectBoundingBoxBracket.cpp
Comment thread trinity/Tr2ProjectBoundingBoxBracket.cpp Outdated
Comment thread trinity/Eve/EveEffectRoot2.cpp Outdated
Comment thread trinity/Eve/EveEffectRoot2.cpp Outdated
Comment thread trinity/Eve/EveTransform.cpp Outdated
Comment thread trinity/Utilities/BoundingBox.cpp Outdated
Comment thread trinity/Utilities/BoundingBox.cpp Outdated
@ccpgames-carbon

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Anonymous CCP Employee seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions
github-actions Bot dismissed their stale review July 21, 2026 10:28

outdated suggestion

@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 v20.1.2

Click here for the full clang-format patch
diff --git a/trinity/Eve/EveEffectRoot2.h b/trinity/Eve/EveEffectRoot2.h
index d9c6003..ff0cd82 100644
--- a/trinity/Eve/EveEffectRoot2.h
+++ b/trinity/Eve/EveEffectRoot2.h
@@ -95 +95 @@ public:
-	bool GetWorldBoundingBox( Vector3& min, Vector3& max ) const override;
+	bool GetWorldBoundingBox( Vector3 & min, Vector3 & max ) const override;

Have any feedback or feature suggestions? Share it here.

Comment thread trinity/Eve/EveEffectRoot2.h Outdated
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions
github-actions Bot dismissed their stale review July 21, 2026 10:43

outdated suggestion

@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 v20.1.2

Click here for the full clang-format patch
diff --git a/trinity/TriMath.cpp b/trinity/TriMath.cpp
index 5fe9a31..058f9ae 100644
--- a/trinity/TriMath.cpp
+++ b/trinity/TriMath.cpp
@@ -898,2 +898 @@ bool IsFinite( const Vector4& vec )
-	return IsFinite( vec.x ) && IsFinite( vec.y )
-		&& IsFinite( vec.z ) && IsFinite( vec.w );
+	return IsFinite( vec.x ) && IsFinite( vec.y ) && IsFinite( vec.z ) && IsFinite( vec.w );

Have any feedback or feature suggestions? Share it here.

Comment thread trinity/TriMath.cpp Outdated
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions
github-actions Bot dismissed their stale review July 21, 2026 13:14

outdated suggestion

@Ikreb1
Ikreb1 requested a review from filipppavlov July 21, 2026 13:21
@Ikreb1 Ikreb1 closed this Jul 21, 2026
@Ikreb1
Ikreb1 deleted the bugfix/BoundingBoxBracket-iteration branch July 21, 2026 15:14
@Ikreb1 Ikreb1 changed the title Bugfix/bounding box bracket iteration Rework bounding box bracket projection and implement ITr2BoundingBox on more space objects Jul 21, 2026
@Ikreb1
Ikreb1 restored the bugfix/BoundingBoxBracket-iteration branch July 21, 2026 15:17
@Ikreb1 Ikreb1 reopened this Jul 21, 2026
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.

4 participants