Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public final class GltfScene
- Object
- GltfScene
The whole of a glTF 2.0 file as plain data: every node of the scene graph,
every triangle primitive, the materials, the skins and the animation clips.
Produced by GltfLoader#loadScene(byte[]).
Nothing here is uploaded to a GraphicsDevice; the vertex data is kept on the
CPU so a renderer can pose it. com.codename1.gaming.AnimatedModel is the
ready made consumer: it samples the clips, skins the vertices and draws the
result as ordinary Meshes.
Node transforms follow the glTF convention: a node’s local matrix is
T * R * S of its translation, rotation (an x, y, z, w quaternion) and
scale, and its world matrix is its parent’s world matrix times that.
Nested types
class GltfScene.Node | One node of the scene graph. |
class GltfScene.Primitive | One triangle primitive, with its vertex data in the node’s local space. |
class GltfScene.MaterialInfo | The parts of a glTF material a Material can express. |
class GltfScene.Skin | A skeleton: the joint nodes and the matrices that take a vertex from the mesh’s bind pose into each joint’s space. |
class GltfScene.Animation | A named animation clip. |
class GltfScene.Channel | Keyframes for one property of one node. |
Methods
Inherited methods
Method details
getNodeCount
public int getNodeCount()getNode
public GltfScene.Node getNode(int index)index.findNode
public int findNode(String name)name, or -1.getRoots
public int[] getRoots()getPrimitiveCount
public int getPrimitiveCount()getPrimitive
public GltfScene.Primitive getPrimitive(int index)index.getMaterialCount
public int getMaterialCount()getMaterial
public GltfScene.MaterialInfo getMaterial(int index)index.getImage
public Image getImage(int index)index, or null when it could not be read.getTexture
public Texture getTexture(GraphicsDevice device, int index)index on device, uploaded on first use and then
shared by every model drawn from this scene. Returns null when the image
could not be decoded. Asking with a different device uploads afresh.getSkinCount
public int getSkinCount()getSkin
public GltfScene.Skin getSkin(int index)index.getAnimationCount
public int getAnimationCount()getAnimation
public GltfScene.Animation getAnimation(int index)index.findAnimation
public GltfScene.Animation findAnimation(String name)name, or null.