Class Attributes

  • All Implemented Interfaces:
    java.io.Serializable

    public class Attributes
    extends java.lang.Object
    implements java.io.Serializable
    Set the attributes you want. The currently supported attributes are p = position 3 or 4 channels (xyz,xyzw) n = normal vector 3 or 4 channels (xyz,xyzw) ci = color 1 to 4 channels (r,rg,rgb,rgba) ti = texture coordinate 1 to 4 channels (s,st,str,strq) The attrbitues are organized internally to have the ordering: p, n, c0, c1, ..., t0, t1, ...
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int m_iChannelQuantity
      The number of 'float' channels used by all attributes.
      private int m_iNChannels
      number of floats per normal.
      private int m_iNOffset
      normal offset.
      private int m_iPChannels
      number of floats per position.
      private int m_iPOffset
      position offset.
      private java.util.Vector<java.lang.Integer> m_kCChannels
      color channels (1-4 color units).
      private java.util.Vector<java.lang.Integer> m_kCOffset
      color offsets (1-4 color units).
      private java.util.Vector<java.lang.Integer> m_kTChannels
      texture coordinate channels (1-4 texture coordinate units).
      private java.util.Vector<java.lang.Integer> m_kTOffset
      texture coordinate offsets (1-4 texture coordinate units).
      private static long serialVersionUID  
    • Constructor Summary

      Constructors 
      Constructor Description
      Attributes()
      Create default VertexBuffer Rendering Attributes:
      Attributes​(Attributes rkA)
      Copy constructor:
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose()
      Delete memory.
      int GetCChannels​(int iUnit)
      Access to color information.
      int GetChannelQuantity()
      The number of 'float' channels used by all the attributes.
      int GetCOffset​(int iUnit)
      Access to color information.
      int GetMaxColors()
      Access to color information.
      int GetMaxTCoords()
      Access to texture coordinate information.
      int GetNChannels()
      Access to normal information.
      int GetNOffset()
      Access to normal information.
      int GetPChannels()
      Access to position information.
      int GetPOffset()
      Access to position information.
      int GetTChannels​(int iUnit)
      Access to texture coordinate information.
      int GetTOffset​(int iUnit)
      Access to texture coordinate information.
      boolean HasColor​(int iUnit)
      Access to color information.
      boolean HasNormal()
      Access to normal information.
      boolean HasPosition()
      Access to position information.
      boolean HasTCoord​(int iUnit)
      Access to texture coordinate information.
      void SetCChannels​(int iUnit, int iCChannels)
      Set color attribute.
      void SetNChannels​(int iNChannels)
      Set normal attribute.
      void SetPChannels​(int iPChannels)
      Set position attribute.
      void SetTChannels​(int iUnit, int iTChannels)
      Set texture coordinate attriubute.
      private void UpdateOffsets()
      Update offsets when attributes change.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • m_iChannelQuantity

        private int m_iChannelQuantity
        The number of 'float' channels used by all attributes.
      • m_iPOffset

        private int m_iPOffset
        position offset.
      • m_iPChannels

        private int m_iPChannels
        number of floats per position.
      • m_iNOffset

        private int m_iNOffset
        normal offset.
      • m_iNChannels

        private int m_iNChannels
        number of floats per normal.
      • m_kCOffset

        private java.util.Vector<java.lang.Integer> m_kCOffset
        color offsets (1-4 color units).
      • m_kCChannels

        private java.util.Vector<java.lang.Integer> m_kCChannels
        color channels (1-4 color units).
      • m_kTOffset

        private java.util.Vector<java.lang.Integer> m_kTOffset
        texture coordinate offsets (1-4 texture coordinate units).
      • m_kTChannels

        private java.util.Vector<java.lang.Integer> m_kTChannels
        texture coordinate channels (1-4 texture coordinate units).
    • Constructor Detail

      • Attributes

        public Attributes()
        Create default VertexBuffer Rendering Attributes:
      • Attributes

        public Attributes​(Attributes rkA)
        Copy constructor:
        Parameters:
        rkA - Attributes to copy.
    • Method Detail

      • dispose

        public void dispose()
        Delete memory.
      • GetCChannels

        public int GetCChannels​(int iUnit)
        Access to color information.
        Returns:
        the number of floats per color.
      • GetChannelQuantity

        public final int GetChannelQuantity()
        The number of 'float' channels used by all the attributes.
      • GetCOffset

        public int GetCOffset​(int iUnit)
        Access to color information.
        Returns:
        the color offset.
      • GetMaxColors

        public final int GetMaxColors()
        Access to color information.
        Returns:
        the number of used colors units.
      • GetMaxTCoords

        public final int GetMaxTCoords()
        Access to texture coordinate information.
        Returns:
        the number of used texture coordinates units.
      • GetNChannels

        public final int GetNChannels()
        Access to normal information.
        Returns:
        the number of floats per normal.
      • GetNOffset

        public final int GetNOffset()
        Access to normal information.
        Returns:
        the normal offset.
      • GetPChannels

        public final int GetPChannels()
        Access to position information.
        Returns:
        the number of floats per position.
      • GetPOffset

        public final int GetPOffset()
        Access to position information.
        Returns:
        the position offset.
      • GetTChannels

        public int GetTChannels​(int iUnit)
        Access to texture coordinate information.
        Returns:
        the number of floats per texture coordinate.
      • GetTOffset

        public int GetTOffset​(int iUnit)
        Access to texture coordinate information.
        Returns:
        the texture coordinate offset.
      • HasColor

        public boolean HasColor​(int iUnit)
        Access to color information.
        Returns:
        true if the color attribute is used.
      • HasNormal

        public final boolean HasNormal()
        Access to normal information.
        Returns:
        true if the normal attribute is used.
      • HasPosition

        public final boolean HasPosition()
        Access to position information.
        Returns:
        true if the position attribute is used.
      • HasTCoord

        public boolean HasTCoord​(int iUnit)
        Access to texture coordinate information.
        Returns:
        true if the texture coordinate attribute is used.
      • SetCChannels

        public void SetCChannels​(int iUnit,
                                 int iCChannels)
        Set color attribute.
        Parameters:
        iUnit - color unit (0-4).
        iCChannels - number of floats per color.
      • SetNChannels

        public void SetNChannels​(int iNChannels)
        Set normal attribute.
        Parameters:
        iNChannels - number of floats per normal.
      • SetPChannels

        public void SetPChannels​(int iPChannels)
        Set position attribute.
        Parameters:
        iPChannels - number of floats per position.
      • SetTChannels

        public void SetTChannels​(int iUnit,
                                 int iTChannels)
        Set texture coordinate attriubute.
        Parameters:
        iUnit - texture unit (0-4).
        iTChannels - number of floats per texture coordinate.
      • UpdateOffsets

        private void UpdateOffsets()
        Update offsets when attributes change.