Skip to content

Add EveVolumeObject for placing box volumes in a scene - #119

Merged
phevosccp merged 18 commits into
mainfrom
volume-object
Oct 16, 2026
Merged

phevosccp merged 18 commits into
mainfrom
volume-object

Conversation

@phevosccp

@phevosccp phevosccp commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Description

This PR created the EveVolumeObject, a standalone object that places a box volume in the scene and passes its world transform to an ITr2BoxVolume consumer attached in the scene file. It works like EveTriggerVolume without the callback, and has no knowledge of what the consumer does with the shape.

Depends on ITr2BoxVolume from carbon-trinityaudioapi carbonengine/trinityaudioapi#7

Disclaimer

Since EveVolumeObject and EveTriggerVolume share their placement and bounds code, it probably makes sense in a follow-up PR to move that into a common base class that both inherit from, so we avoid the duplicate code.

Changes

  • New EveVolumeObject
  • Sends the enabled state, then the unit box world transform, whenever the transform changes. The scene origin follows the ego ball, so the transform changes every frame the player moves.
  • Removes the shape from the consumer when the object leaves the scene and puts it back on ReregisterEntities
  • Handles the consumer or box being replaced or cleared, e.g. in Graphite
  • EveBoxVolume::GetBoxTransform() accessor
  • "Volume Objects" debug render option

Testing

Tested locally end-to-end with carbon-audio , was able to place rooms and see them in the wwise profiler.

@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/Eve/EveVolumeObject.cpp b/trinity/Eve/EveVolumeObject.cpp
index d5e6811..76f491b 100644
--- a/trinity/Eve/EveVolumeObject.cpp
+++ b/trinity/Eve/EveVolumeObject.cpp
@@ -149,2 +149 @@ void EveVolumeObject::ResolveBoxVolume()
-		m_boxChangeCallbackID = m_boxVolume->RegisterForChanges( [this]()
-		{
+		m_boxChangeCallbackID = m_boxVolume->RegisterForChanges( [this]() {
@@ -178,4 +177 @@ bool EveVolumeObject::TransformsNearlyEqual( const Matrix& a, const Matrix& b )
-	return XMVector3NearEqual( a.GetX(), b.GetX(), axisEpsilon )
-		&& XMVector3NearEqual( a.GetY(), b.GetY(), axisEpsilon )
-		&& XMVector3NearEqual( a.GetZ(), b.GetZ(), axisEpsilon )
-		&& XMVector3NearEqual( a.GetTranslation(), b.GetTranslation(), translationEpsilon );
+	return XMVector3NearEqual( a.GetX(), b.GetX(), axisEpsilon ) && XMVector3NearEqual( a.GetY(), b.GetY(), axisEpsilon ) && XMVector3NearEqual( a.GetZ(), b.GetZ(), axisEpsilon ) && XMVector3NearEqual( a.GetTranslation(), b.GetTranslation(), translationEpsilon );
diff --git a/trinity/Eve/Volume/EveBoxVolume.h b/trinity/Eve/Volume/EveBoxVolume.h
index 4790083..6073bb1 100644
--- a/trinity/Eve/Volume/EveBoxVolume.h
+++ b/trinity/Eve/Volume/EveBoxVolume.h
@@ -40 +40,4 @@ public:
-	const Matrix& GetBoxTransform() const { return m_boxTransform; }
+	const Matrix& GetBoxTransform() const
+	{
+		return m_boxTransform;
+	}

Have any feedback or feature suggestions? Share it here.

Comment thread trinity/Eve/EveVolumeObject.cpp Outdated
Comment thread trinity/Eve/EveVolumeObject.cpp Outdated
Comment thread trinity/Eve/Volume/EveBoxVolume.h Outdated
@github-actions
github-actions Bot dismissed their stale review October 9, 2026 13:19

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 v21.1.8

Click here for the full clang-format patch
diff --git a/trinity/Eve/EveVolumeObject.cpp b/trinity/Eve/EveVolumeObject.cpp
index d5e6811..76f491b 100644
--- a/trinity/Eve/EveVolumeObject.cpp
+++ b/trinity/Eve/EveVolumeObject.cpp
@@ -149,2 +149 @@ void EveVolumeObject::ResolveBoxVolume()
-		m_boxChangeCallbackID = m_boxVolume->RegisterForChanges( [this]()
-		{
+		m_boxChangeCallbackID = m_boxVolume->RegisterForChanges( [this]() {
@@ -178,4 +177 @@ bool EveVolumeObject::TransformsNearlyEqual( const Matrix& a, const Matrix& b )
-	return XMVector3NearEqual( a.GetX(), b.GetX(), axisEpsilon )
-		&& XMVector3NearEqual( a.GetY(), b.GetY(), axisEpsilon )
-		&& XMVector3NearEqual( a.GetZ(), b.GetZ(), axisEpsilon )
-		&& XMVector3NearEqual( a.GetTranslation(), b.GetTranslation(), translationEpsilon );
+	return XMVector3NearEqual( a.GetX(), b.GetX(), axisEpsilon ) && XMVector3NearEqual( a.GetY(), b.GetY(), axisEpsilon ) && XMVector3NearEqual( a.GetZ(), b.GetZ(), axisEpsilon ) && XMVector3NearEqual( a.GetTranslation(), b.GetTranslation(), translationEpsilon );
diff --git a/trinity/Eve/Volume/EveBoxVolume.h b/trinity/Eve/Volume/EveBoxVolume.h
index 4790083..6073bb1 100644
--- a/trinity/Eve/Volume/EveBoxVolume.h
+++ b/trinity/Eve/Volume/EveBoxVolume.h
@@ -40 +40,4 @@ public:
-	const Matrix& GetBoxTransform() const { return m_boxTransform; }
+	const Matrix& GetBoxTransform() const
+	{
+		return m_boxTransform;
+	}

Have any feedback or feature suggestions? Share it here.

Comment thread trinity/Eve/EveVolumeObject.cpp Outdated
Comment thread trinity/Eve/EveVolumeObject.cpp Outdated
Comment thread trinity/Eve/Volume/EveBoxVolume.h Outdated
phevosccp and others added 2 commits October 12, 2026 09:28
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions
github-actions Bot dismissed their stale review October 12, 2026 09:29

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 v21.1.8

Click here for the full clang-format patch
diff --git a/trinity/Eve/Volume/EveBoxVolume.h b/trinity/Eve/Volume/EveBoxVolume.h
index 4790083..6073bb1 100644
--- a/trinity/Eve/Volume/EveBoxVolume.h
+++ b/trinity/Eve/Volume/EveBoxVolume.h
@@ -40 +40,4 @@ public:
-	const Matrix& GetBoxTransform() const { return m_boxTransform; }
+	const Matrix& GetBoxTransform() const
+	{
+		return m_boxTransform;
+	}

Have any feedback or feature suggestions? Share it here.

Comment thread trinity/Eve/Volume/EveBoxVolume.h
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions
github-actions Bot dismissed their stale review October 12, 2026 09:29

outdated suggestion

Comment thread trinity/Eve/Volume/EveBoxVolume.h Outdated

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.

🟡 Changes recommended

The header does not compile, and re-registration can publish stale volume state.

1 open finding
What changed in this PR

Adds EveVolumeObject to publish box-volume transforms to scene consumers.

Changes:

  • Adds volume placement, lifecycle handling, and debug rendering.
  • Exposes EveBoxVolume transforms.
  • Registers new sources with CMake.
File Description
trinity/​Eve/​Volume/​EveBoxVolume.h Exposes the box transform.
trinity/​Eve/​EveVolumeObject.h Declares the new scene object.
trinity/​Eve/​EveVolumeObject.cpp Implements volume publishing and lifecycle behavior.
trinity/​Eve/​EveVolumeObject_Blue.cpp Exposes properties to Blue.
trinity/​CMakeLists.txt Adds the new sources.

🧠 Review effort: Balanced


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

Comment thread trinity/Eve/EveVolumeObject.cpp Outdated
Comment thread trinity/Eve/EveVolumeObject_Blue.cpp Outdated
Comment thread trinity/Eve/EveVolumeObject.cpp Outdated
Comment thread trinity/Eve/EveVolumeObject.cpp Outdated
@phevosccp
phevosccp merged commit 3fa5aad into main Oct 16, 2026
1 check passed
@phevosccp
phevosccp deleted the volume-object branch October 16, 2026 10:26
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.

3 participants