-
Notifications
You must be signed in to change notification settings - Fork 1
Reduce duplication in gizmos/MCP + raise transform test coverage #277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
727c359
reposition website as 3D asset pipeline tool
fernandotonon f63185f
Merge branch 'master' into codex/pipeline-website-positioning
fernandotonon 7a2d2a7
address review feedback for website pipeline PR
fernandotonon 21d00bb
test: increase CLI and scan coverage
fernandotonon 7ccf6a5
Reduce duplication across gizmos/MCP and expand transform coverage
fernandotonon c5887e9
Merge remote-tracking branch 'origin/master' into codex/coverage-over…
fernandotonon dd2ac28
Make CmdAnim no-animation test skip when mesh reload is unavailable
fernandotonon 159800d
Stabilize no-animation CLI test across environments
fernandotonon b4bac83
Colorize scan text status and add summary icons
fernandotonon 91af5e7
Merge branch 'master' into codex/coverage-over-80-again
fernandotonon e7d8f95
Stream scan output and colorize status labels
fernandotonon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| #ifndef GIZMOAXISHELPERS_H | ||
| #define GIZMOAXISHELPERS_H | ||
|
|
||
| #include <Ogre.h> | ||
|
|
||
| namespace GizmoAxisHelpers { | ||
|
|
||
| enum class Axis { | ||
| X, | ||
| Y, | ||
| Z, | ||
| None | ||
| }; | ||
|
|
||
| template <typename Fn> | ||
| inline void forEachAxis(Ogre::ManualObject* xAxis, | ||
| Ogre::ManualObject* yAxis, | ||
| Ogre::ManualObject* zAxis, | ||
| Fn&& fn) | ||
| { | ||
| fn(xAxis); | ||
| fn(yAxis); | ||
| fn(zAxis); | ||
| } | ||
|
|
||
| template <typename Fn> | ||
| inline void forEachAxisIndexed(Ogre::ManualObject* xAxis, | ||
| Ogre::ManualObject* yAxis, | ||
| Ogre::ManualObject* zAxis, | ||
| Fn&& fn) | ||
| { | ||
| fn(Axis::X, xAxis); | ||
| fn(Axis::Y, yAxis); | ||
| fn(Axis::Z, zAxis); | ||
| } | ||
|
|
||
| inline Axis axisFromObject(const Ogre::MovableObject* obj, | ||
| const Ogre::ManualObject* xAxis, | ||
| const Ogre::ManualObject* yAxis, | ||
| const Ogre::ManualObject* zAxis) | ||
| { | ||
| if (!obj) { | ||
| return Axis::None; | ||
| } | ||
| if (obj == static_cast<const Ogre::MovableObject*>(xAxis)) { | ||
| return Axis::X; | ||
| } | ||
| if (obj == static_cast<const Ogre::MovableObject*>(yAxis)) { | ||
| return Axis::Y; | ||
| } | ||
| if (obj == static_cast<const Ogre::MovableObject*>(zAxis)) { | ||
| return Axis::Z; | ||
| } | ||
| return Axis::None; | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| } | ||
|
|
||
| inline Ogre::Vector3 axisToUnitVector(Axis axis) | ||
| { | ||
| switch (axis) { | ||
| case Axis::X: | ||
| return Ogre::Vector3::UNIT_X; | ||
| case Axis::Y: | ||
| return Ogre::Vector3::UNIT_Y; | ||
| case Axis::Z: | ||
| return Ogre::Vector3::UNIT_Z; | ||
| case Axis::None: | ||
| break; | ||
| } | ||
|
|
||
| return Ogre::Vector3::ZERO; | ||
| } | ||
|
|
||
| inline Ogre::AxisAlignedBox makeAxisBoundingBox(Axis axis, | ||
| Ogre::Real axisMin, | ||
| Ogre::Real axisMax, | ||
| Ogre::Real sideExtent) | ||
| { | ||
| Ogre::AxisAlignedBox boundingBox; | ||
| switch (axis) { | ||
| case Axis::X: | ||
| boundingBox.setExtents(Ogre::Vector3(axisMin, -sideExtent, -sideExtent), | ||
| Ogre::Vector3(axisMax, sideExtent, sideExtent)); | ||
| break; | ||
| case Axis::Y: | ||
| boundingBox.setExtents(Ogre::Vector3(-sideExtent, axisMin, -sideExtent), | ||
| Ogre::Vector3( sideExtent, axisMax, sideExtent)); | ||
| break; | ||
| case Axis::Z: | ||
| boundingBox.setExtents(Ogre::Vector3(-sideExtent, -sideExtent, axisMin), | ||
| Ogre::Vector3( sideExtent, sideExtent, axisMax)); | ||
| break; | ||
| case Axis::None: | ||
| break; | ||
| } | ||
| return boundingBox; | ||
| } | ||
|
|
||
| template <typename OnX, typename OnY, typename OnZ, typename OnNone> | ||
| inline void dispatchAxis(Axis axis, OnX&& onX, OnY&& onY, OnZ&& onZ, OnNone&& onNone) | ||
| { | ||
| switch (axis) { | ||
| case Axis::X: | ||
| onX(); | ||
| break; | ||
| case Axis::Y: | ||
| onY(); | ||
| break; | ||
| case Axis::Z: | ||
| onZ(); | ||
| break; | ||
| case Axis::None: | ||
| onNone(); | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| } // namespace GizmoAxisHelpers | ||
|
|
||
| #endif // GIZMOAXISHELPERS_H | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.