Class ColladaAbstractGeometry

    • Field Detail

      • DEFAULT_TEX_COORD_SEMANTIC

        public static final java.lang.String DEFAULT_TEX_COORD_SEMANTIC
        Default semantic that identifies texture coordinates. Used the a file does not specify the semantic using a bind_vertex_input element.
        See Also:
        Constant Field Values
      • COORDS_PER_VERTEX

        public static final int COORDS_PER_VERTEX
        Number of coordinates per vertex.
        See Also:
        Constant Field Values
      • TEX_COORDS_PER_VERTEX

        public static final int TEX_COORDS_PER_VERTEX
        Number of texture coordinates per vertex.
        See Also:
        Constant Field Values
      • inputs

        protected java.util.List<ColladaInput> inputs
        Inputs for the geometry. Inputs provide the geometry with vertices, texture coordinates, etc.
    • Constructor Detail

      • ColladaAbstractGeometry

        public ColladaAbstractGeometry​(java.lang.String ns)
        Create a new instance.
        Parameters:
        ns - the qualifying namespace URI. May be null to indicate no namespace qualification.
    • Method Detail

      • getVerticesPerShape

        protected abstract int getVerticesPerShape()
        Indicates the number of vertices per shape in the geometry.
        Returns:
        The number of vertices in each shape.
      • getInputs

        public java.util.List<ColladaInput> getInputs()
        Indicates the inputs that provide vertices, textures coordinates, etc. to the geometry.
        Returns:
        Inputs to the geometry.
      • getCount

        public int getCount()
        Indicates the number of shapes (lines or triangles) in the geometry.
        Returns:
        The number of shapes in the geometry.
      • getMaterial

        public java.lang.String getMaterial()
        Indicates the identifier for the material applied to this geometry.
        Returns:
        The material applied to this geometry. May be null.
      • getVertices

        public void getVertices​(java.nio.FloatBuffer buffer)
        Retrieves the coordinates of vertices in this geometry.
        Parameters:
        buffer - Buffer to receive coordinates.
      • getNormals

        public void getNormals​(java.nio.FloatBuffer buffer)
        Retrieves normal vectors in this geometry.
        Parameters:
        buffer - Buffer to receive coordinates.
      • getTextureCoordinates

        public void getTextureCoordinates​(java.nio.FloatBuffer buffer,
                                          java.lang.String semantic)
        Retrieves the texture coordinates of vertices in this geometry.
        Parameters:
        buffer - Buffer to receive coordinates.
        semantic - String to identify which input holds the texture coordinates. May be null, in which case the "TEXCOORD" is used.
      • getFloatFromAccessor

        protected void getFloatFromAccessor​(java.nio.FloatBuffer buffer,
                                            ColladaAccessor accessor,
                                            java.lang.String semantic,
                                            int floatsPerVertex)
        Retrieve numbers from an accessor.
        Parameters:
        buffer - Buffer to receive floats.
        accessor - Accessor that will provide floats.
        semantic - Semantic that identifiers the set of indices to use (for example, "VERTEX" or "NORMAL").
        floatsPerVertex - Number of floats to read for each vertex.
      • getIndices

        protected int[] getIndices​(java.lang.String semantic)
      • getTexCoordAccessor

        public ColladaAccessor getTexCoordAccessor​(java.lang.String semantic)
        Indicates the accessor for texture coordinates.
        Parameters:
        semantic - Semantic that identifies the texture coordinates. May be null, in which case the semantic "TEXCOORD" is used.
        Returns:
        The texture coordinates accessor, or null if the accessor cannot be resolved.