-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Deprecation of Ogre Loader #2713
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
Open
NwosuTy
wants to merge
9
commits into
jMonkeyEngine:master
Choose a base branch
from
NwosuTy:Dev_Conceited-Ogre-Depreciation
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9f361f7
Depreciation of Ogre Loader
NwosuTy 3d13279
Few Tweaks Added to Last Commit
NwosuTy c0ba6a5
Fixed Casting Issues regarding GLTF Models
NwosuTy 5406b48
Debugging
NwosuTy 0a9681e
Migrate 3D models from Ogre XML to glTF format
NwosuTy 59df30a
Merge branch 'master' into Dev_Conceited-Ogre-Depreciation
NwosuTy 8ad71d1
Animated Objects Inclusion Gltf
NwosuTy ec5457a
Requested Changes Fixed
NwosuTy 07cd979
Fix Test Errors
NwosuTy 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
86 changes: 86 additions & 0 deletions
86
jme3-examples/src/main/java/jme3test/app/SpatialUtils.java
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,86 @@ | ||
| package jme3test.app; | ||
|
|
||
| import com.jme3.scene.Geometry; | ||
| import com.jme3.scene.Node; | ||
| import com.jme3.scene.Spatial; | ||
|
|
||
| /** | ||
| * Utility class for working with spatial hierarchies. | ||
| * Provides helper methods for searching and manipulating spatial scene graphs. | ||
| */ | ||
| public class SpatialUtils { | ||
|
|
||
| /** | ||
| * Recursively finds the first Geometry in a spatial hierarchy. | ||
| * This is useful for handling both simple flat structures (Ogre models) and | ||
| * complex nested node trees (glTF models). | ||
| * | ||
| * @param spatial The root spatial to search from | ||
| * @return The first Geometry found, or null if none exists | ||
| */ | ||
| public static Geometry findFirstGeometry(Spatial spatial) { | ||
| if (spatial instanceof Geometry) { | ||
| return (Geometry) spatial; | ||
| } | ||
| if (spatial instanceof Node) { | ||
| Node node = (Node) spatial; | ||
| for (Spatial child : node.getChildren()) { | ||
| Geometry geom = findFirstGeometry(child); | ||
| if (geom != null) { | ||
| return geom; | ||
| } | ||
| } | ||
| } | ||
| return null; | ||
| } | ||
|
|
||
| /** | ||
| * Recursively finds a Geometry by name in a spatial hierarchy. | ||
| * Searches depth-first through the entire spatial tree. | ||
| * | ||
| * @param spatial The root spatial to search from | ||
| * @param name The name of the geometry to find | ||
| * @return The Geometry with the matching name, or null if not found | ||
| */ | ||
| public static Geometry findGeometryByName(Spatial spatial, String name) { | ||
| if (spatial.getName() != null && spatial.getName().equals(name) && spatial instanceof Geometry) { | ||
| return (Geometry) spatial; | ||
| } | ||
| if (spatial instanceof Node) { | ||
| Node node = (Node) spatial; | ||
| for (Spatial child : node.getChildren()) { | ||
| Geometry geom = findGeometryByName(child, name); | ||
| if (geom != null) { | ||
| return geom; | ||
| } | ||
| } | ||
| } | ||
| return null; | ||
| } | ||
|
|
||
| /** | ||
| * Counts the total number of Geometries in a spatial hierarchy. | ||
| * Useful for debugging and understanding scene structure. | ||
| * | ||
| * @param spatial The root spatial to count from | ||
| * @return The total number of geometries in the hierarchy | ||
| */ | ||
| public static int countGeometries(Spatial spatial) { | ||
| if (spatial instanceof Geometry) { | ||
| return 1; | ||
| } | ||
| if (spatial instanceof Node) { | ||
| int count = 0; | ||
| Node node = (Node) spatial; | ||
| for (Spatial child : node.getChildren()) { | ||
| count += countGeometries(child); | ||
| } | ||
| return count; | ||
| } | ||
| return 0; | ||
| } | ||
|
|
||
| private SpatialUtils() { | ||
| // Utility class, no instantiation | ||
| } | ||
| } |
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
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
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
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
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.