gdx-gltf icon indicating copy to clipboard operation
gdx-gltf copied to clipboard

Better names for Scene related stuff

Open mgsx-dev opened this issue 4 years ago • 3 comments

Some classes names are a bit misleading for libgdx users we have :

  • SceneAsset is what you load, it contains several SceneModel, there are no equivalent in libgdx since GLTF allow multiple scenes (multiple Model) in the same file.
  • SceneModel is the equivalent of Model in libgdx.
  • Scene is the equivalent of ModelInstance in libgdx, it could be renamed as "SceneInstance".
  • SceneManager has no equivalent in libgdx, it handles both animations and rendering. Singular Scene word is misleading since it handles several scenes (scene instances), maybe SceneGraph or SceneTree could be better names.

mgsx-dev avatar Mar 01 '20 11:03 mgsx-dev

Also some other classes was named pretty badly. Since there are not tight coupled to the GLTF format, it doesn't make sense to prefix them with GLTF, the idea would be to use a common suffix for them. Best candidate so far would be "Ex" as in "Extended".

problematic classes :

  • AnimationControllerHack, NodeAnimationHack and ModelInstanceHack add supports for morphTarget and new keyframe interpolations.
  • NodePlus and NodePartPlus add supports for morphTarget.
  • DirectionalLightEx, supports intensity.
  • PointLightEx and SpotLightEx have a range.
  • DirectionalShadowLight is the core DirectionalShadowLight version of DirectionalLightEx.

mgsx-dev avatar Mar 02 '21 16:03 mgsx-dev

As a newbie to 3D game design, I was confused only by the "Scene" class name. I've instead just made my own class named "SceneModelInstance" that wraps it, but I read that a Scene can have multiple models. Is that a GLTF thing, or is it actually possible to put multiple GLTF's into one model instance?

cosmicdan avatar Dec 28 '21 23:12 cosmicdan

Thing is, the Scene class is more than a ModelInstance wrapper, it also wraps an AnimationController, lights, and cameras. The term "scene" indeed comes from GLTF format specification. A GLTF file can have several scenes, it typically only contains one scene though. Also, you're free to merge several Scene's into one, the same way you can merge several ModelInstances.

mgsx-dev avatar Dec 29 '21 01:12 mgsx-dev