Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public static final class GltfScene.Primitive

  1. Object
  2. GltfScene.Primitive
One triangle primitive, with its vertex data in the node’s local space.

Methods

public int getNode()The node that places this primitive.
public int getMaterial()The material index, or -1.
public int getVertexCount()The number of vertices.
public float[] getPositions()x, y, z per vertex.
public float[] getNormals()x, y, z per vertex; computed flat normals when the file has none.
public float[] getTexcoords()u, v per vertex, or null.
public int[] getIndices()Triangle indices.
public int[] getJoints()Four joint indices per vertex (indices into the skin’s joint list), or null when the primitive is not skinned.
public float[] getWeights()Four weights per vertex, or null when the primitive is not skinned.
public boolean isSkinned()True when the primitive carries joints and weights.

Inherited methods

Method details

getNode

public int getNode()
The node that places this primitive.

getMaterial

public int getMaterial()
The material index, or -1.

getVertexCount

public int getVertexCount()
The number of vertices.

getPositions

public float[] getPositions()
x, y, z per vertex.

getNormals

public float[] getNormals()
x, y, z per vertex; computed flat normals when the file has none.

getTexcoords

public float[] getTexcoords()
u, v per vertex, or null.

getIndices

public int[] getIndices()
Triangle indices.

getJoints

public int[] getJoints()
Four joint indices per vertex (indices into the skin’s joint list), or null when the primitive is not skinned.

getWeights

public float[] getWeights()
Four weights per vertex, or null when the primitive is not skinned.

isSkinned

public boolean isSkinned()
True when the primitive carries joints and weights.