Class Primitive

    • Constructor Detail

      • Primitive

        protected Primitive()
        Construct an empty Primitive.
      • Primitive

        protected Primitive​(int... indices)
        Construct a Primitive with the given array of indices for the Vertex and Color index lists.

        NOTE: This constructor does not put any Vertex or Color objects into this Primitive's Model object. This constructor assumes that the given indices are valid (or will be valid by the time this Primitive gets rendered).

        Parameters:
        indices - array of Vertex and Color indices to place in this Primitive
    • Method Detail

      • addIndex

        public void addIndex​(int... indices)
        Add the given array of indices to the Vertex and Color index lists.

        NOTE: This method does not put any Vertex or Color objects into this Primitive's Model object. This method assumes that the given indices are valid (or will be valid by the time this Primitive gets rendered).

        Parameters:
        indices - array of Vertex and Color indices to add to this Primitive
      • addIndices

        public void addIndices​(int vIndex,
                               int cIndex)
        Add the given indices to the Vertex and Color index lists.

        NOTE: This method does not put any Vertex or Color objects into this Primitive's Model object. This method assumes that the given indices are valid (or will be valid by the time this Primitive gets rendered).

        Parameters:
        vIndex - integer Vertex index to add to this Primitive
        cIndex - integer Color index to add to this Primitive
      • setColorIndices

        public void setColorIndices​(int... cIndices)
        Set the Color index list to the given array of indices.

        NOTE: This method does not put any Color objects into this Primitive's Model object. This method assumes that the given indices are valid (or will be valid by the time this Primitive gets rendered).

        Parameters:
        cIndices - array of Color indices for this Primitive
        Throws:
        IllegalArgumentException - if cIndices does not have the correct length for this Primitive
      • setColorIndex

        public void setColorIndex​(int cIndex)
        Give this Primitive the uniform Color indexed by the given color index.

        NOTE: This method does not put a Color object into this Primitive's Model object. This method assumes that the given index is valid (or will be valid by the time this Primitive gets rendered).

        Parameters:
        cIndex - integer color index to use for this Primitive's Color