Codota Logo
Accessors
Code IndexAdd Codota to your IDE (free)

How to use
Accessors
in
de.javagl.jgltf.model

Best Java code snippets using de.javagl.jgltf.model.Accessors (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: javagl/JglTF

@Override
public int getComponentSizeInBytes()
{
  return Accessors.getNumBytesForAccessorComponentType(componentType);
}
 
origin: javagl/JglTF

@Override
public Class<?> getComponentDataType()
{
  return Accessors.getDataTypeForAccessorComponentType(
    getComponentType());
}
 
origin: javagl/JglTF

  GltfConstants.stringFor(accessor.getComponentType());
int componentSizeInBytes =
  Accessors.getNumBytesForAccessorComponentType(componentType);
int numComponents = 
  Accessors.getNumComponentsForAccessorType(accessor.getType());
int elementSizeInBytes = numComponents * componentSizeInBytes;
origin: javagl/JglTF

/**
 * Create a byte buffer containing the data of the indices for the
 * given OBJ. The face vertex indices of the given OBJ will be 
 * extracted (assuming that it contains only triangles), converted
 * to the given indices component type (which is a GL constant like
 * GL_SHORT), and a byte buffer containing these indices will be returned.
 * 
 * @param obj The OBJ
 * @param indicesComponentType The indices component type
 * @return The byte buffer
 */
private static ByteBuffer createIndicesByteBuffer(
  ReadableObj obj, int indicesComponentType)
{
  int numVerticesPerFace = 3;
  IntBuffer objIndices = 
    ObjData.getFaceVertexIndices(obj, numVerticesPerFace);
  int indicesComponentSize =
    Accessors.getNumBytesForAccessorComponentType(
      indicesComponentType);
  ByteBuffer indicesByteBuffer = 
    IntBuffers.convertToByteBuffer(objIndices, indicesComponentSize);
  return indicesByteBuffer;
}
 
origin: javagl/JglTF

/**
 * Create a byte buffer containing the data of the indices for the
 * given OBJ. The face vertex indices of the given OBJ will be 
 * extracted (assuming that it contains only triangles), converted
 * to the given indices component type (which is a GL constant like
 * GL_SHORT), and a byte buffer containing these indices will be returned.
 * 
 * @param obj The OBJ
 * @param indicesComponentType The indices component type
 * @return The byte buffer
 */
private static ByteBuffer createIndicesByteBuffer(
  ReadableObj obj, int indicesComponentType)
{
  int numVerticesPerFace = 3;
  IntBuffer objIndices = 
    ObjData.getFaceVertexIndices(obj, numVerticesPerFace);
  int indicesComponentSize =
    Accessors.getNumBytesForAccessorComponentType(
      indicesComponentType);
  ByteBuffer indicesByteBuffer = 
    IntBuffers.convertToByteBuffer(objIndices, indicesComponentSize);
  return indicesByteBuffer;
}
 
origin: javagl/JglTF

/**
 * Create an {@link AccessorModel} in the {@link BufferStructure} that 
 * is currently being built.
 * 
 * @param id The ID of the {@link AccessorModel}
 * @param componentType The component type, as a GL constant
 * @param type The type of the data, as a string corresponding to
 * the {@link ElementType} of the accessor
 * @param byteBuffer The actual data
 */
public void createAccessorModel(String id,
  int componentType, String type, ByteBuffer byteBuffer)
{
  ElementType elementType = ElementType.valueOf(type);
  int numComponents = elementType.getNumComponents();
  int numBytesPerComponent = 
    Accessors.getNumBytesForAccessorComponentType(componentType);
  int numBytesPerElement = numComponents * numBytesPerComponent;
  int count = byteBuffer.capacity() / numBytesPerElement;
  DefaultAccessorModel accessorModel = new DefaultAccessorModel(
    componentType, count, elementType);
  bufferStructure.addAccessorModel(accessorModel, id);
  currentAccessorModels.add(accessorModel);
  rawAccessorModelByteBuffers.put(accessorModel, byteBuffer);
}
 
origin: javagl/JglTF

/**
 * Create a {@link DefaultAccessorModel} for the given {@link Accessor}
 * 
 * @param accessor The {@link Accessor}
 * @return The {@link AccessorModel}
 */
private static DefaultAccessorModel createAccessorModel(Accessor accessor)
{
  Integer componentType = accessor.getComponentType();
  Integer byteOffset = accessor.getByteOffset();
  Integer count = accessor.getCount();
  ElementType elementType = ElementType.forString(accessor.getType());
  Integer byteStride = accessor.getByteStride();
  if (byteStride == null)
  {
    byteStride = elementType.getNumComponents() *
      Accessors.getNumBytesForAccessorComponentType(
        componentType);
  }
  DefaultAccessorModel accessorModel = new DefaultAccessorModel(
    componentType, count, elementType);
  accessorModel.setByteOffset(byteOffset);
  accessorModel.setByteStride(byteStride);
  return accessorModel;
}
de.javagl.jgltf.modelAccessors

Javadoc

Utility methods related to accessor properties.

Unless otherwise noted, none of the arguments to these methods may be null.

Most used methods

  • getNumBytesForAccessorComponentType
    Returns the number of bytes that one component with the given accessor component type consists of. V
  • getDataTypeForAccessorComponentType
    Returns the data type for the given accessor component type. Valid parameters and their return value
  • getNumComponentsForAccessorType
    Returns the number of components that one element has for the given accessor type. Valid parameters

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (Timer)
  • getContentResolver (Context)
  • getSharedPreferences (Context)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Menu (java.awt)
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • ImageIO (javax.imageio)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now