Class SoftwareVertexProperty


  • public class SoftwareVertexProperty
    extends java.lang.Object
    This class maintains the following properties for a vertex.

    - position (required) - normal (required) - diffuse (optional) - specular (optional)

    The optional properties are specified by setting their references to null. In this case, the value will be determined from the SoftwareMaterial reference that is specified.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private javax.vecmath.Color3f m_kDiffuse
      DOCUMENT ME!
      private javax.vecmath.Vector3f m_kNormal
      DOCUMENT ME!
      private javax.vecmath.Point3f m_kPosition
      By default, vertex diffuse and specular colors are optional.
      private javax.vecmath.Color3f m_kSpecular
      DOCUMENT ME!
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void enableDiffuse​(boolean bEnable)
      Enable/disable the optional diffuse color vertex property.
      void enableSpecular​(boolean bEnable)
      Enable/disable the optional specular color vertex property.
      javax.vecmath.Color3f getDiffuse()
      Query current optional diffuse color for vertex.
      javax.vecmath.Vector3f getNormal()
      Query current normal vector for vertex.
      javax.vecmath.Point3f getPosition()
      Query current position of vertex.
      javax.vecmath.Color3f getSpecular()
      Query current optional specular color for vertex.
      boolean isEnabledDiffuse()
      Query if the vertex diffuse color property is enabled.
      boolean isEnabledSpecular()
      Query if the vertex specular color property is enabled.
      void setDiffuse​(float fR, float fG, float fB)
      Set the diffuse color for the vertex.
      void setDiffuse​(javax.vecmath.Color3f kDiffuse)
      Set the diffuse color for the vertex.
      void setNormal​(float fX, float fY, float fZ)
      Set the normal vector for the vertex.
      void setNormal​(javax.vecmath.Vector3f kNormal)
      Set the normal vector for the vertex.
      void setPosition​(float fX, float fY, float fZ)
      Set the position of the vertex.
      void setPosition​(javax.vecmath.Point3f kPosition)
      Set the position of the vertex.
      void setSpecular​(float fR, float fG, float fB)
      Set the specular color for the vertex.
      void setSpecular​(javax.vecmath.Color3f kSpecular)
      Set the specular color for the vertex.
      • Methods inherited from class java.lang.Object

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

      • m_kDiffuse

        private javax.vecmath.Color3f m_kDiffuse
        DOCUMENT ME!
      • m_kNormal

        private javax.vecmath.Vector3f m_kNormal
        DOCUMENT ME!
      • m_kPosition

        private javax.vecmath.Point3f m_kPosition
        By default, vertex diffuse and specular colors are optional.
      • m_kSpecular

        private javax.vecmath.Color3f m_kSpecular
        DOCUMENT ME!
    • Constructor Detail

      • SoftwareVertexProperty

        public SoftwareVertexProperty()
        Default constructor. Default vertex properties.
    • Method Detail

      • enableDiffuse

        public final void enableDiffuse​(boolean bEnable)
        Enable/disable the optional diffuse color vertex property. Must call this method to enable the property before calling the setDiffuse method to change its value. If enabling the property, the default color is set to white.
        Parameters:
        bEnable - boolean True to enable; false to disable.
      • enableSpecular

        public final void enableSpecular​(boolean bEnable)
        Enable/disable the optional specular color vertex property. Must call this method to enable the property before calling the setSpecular method to change its value. If enabling the property, the default color is set to white.
        Parameters:
        bEnable - boolean True to enable; false to disable.
      • getDiffuse

        public final javax.vecmath.Color3f getDiffuse()
        Query current optional diffuse color for vertex. Can also be used to determine if this property is enabled.
        Returns:
        Color3f Non-null reference to vertex diffuse color if it is defined.
      • getNormal

        public final javax.vecmath.Vector3f getNormal()
        Query current normal vector for vertex.
        Returns:
        Vector3f Non-null reference to vertex normal.
      • getPosition

        public final javax.vecmath.Point3f getPosition()
        Query current position of vertex.
        Returns:
        Point3f Non-null reference to vertex position.
      • getSpecular

        public final javax.vecmath.Color3f getSpecular()
        Query current optional specular color for vertex. Can also be used to determine if this property is enabled.
        Returns:
        Color3f Non-null reference to vertex specular color if it is defined.
      • isEnabledDiffuse

        public final boolean isEnabledDiffuse()
        Query if the vertex diffuse color property is enabled.
        Returns:
        boolean True if enabled.
      • isEnabledSpecular

        public final boolean isEnabledSpecular()
        Query if the vertex specular color property is enabled.
        Returns:
        boolean True if enabled.
      • setDiffuse

        public final void setDiffuse​(javax.vecmath.Color3f kDiffuse)
        Set the diffuse color for the vertex. The vertex diffuse color property must be enabled.
        Parameters:
        kDiffuse - Color3f Diffuse color for the vertex.
      • setDiffuse

        public final void setDiffuse​(float fR,
                                     float fG,
                                     float fB)
        Set the diffuse color for the vertex.
        Parameters:
        fR - float Red channel of vertex diffuse color.
        fG - float Green channel of vertex diffuse color.
        fB - float Blue channel of vertex diffuse color.
      • setNormal

        public final void setNormal​(javax.vecmath.Vector3f kNormal)
        Set the normal vector for the vertex.
        Parameters:
        kNormal - Vector3f Normal vector for the vertex.
      • setNormal

        public final void setNormal​(float fX,
                                    float fY,
                                    float fZ)
        Set the normal vector for the vertex.
        Parameters:
        fX - float X coordinate of vertex normal vector.
        fY - float Y coordinate of vertex normal vector.
        fZ - float Z coordinate of vertex normal vector.
      • setPosition

        public final void setPosition​(javax.vecmath.Point3f kPosition)
        Set the position of the vertex.
        Parameters:
        kPosition - Point3f Position coordinates for the vertex.
      • setPosition

        public final void setPosition​(float fX,
                                      float fY,
                                      float fZ)
        Set the position of the vertex.
        Parameters:
        fX - float X coordinate of vertex position.
        fY - float Y coordinate of vertex position.
        fZ - float Z coordinate of vertex position.
      • setSpecular

        public final void setSpecular​(javax.vecmath.Color3f kSpecular)
        Set the specular color for the vertex. The vertex specular color property must be enabled.
        Parameters:
        kSpecular - Color3f Specular color for the vertex.
      • setSpecular

        public final void setSpecular​(float fR,
                                      float fG,
                                      float fB)
        Set the specular color for the vertex.
        Parameters:
        fR - float Red channel of vertex specular color.
        fG - float Green channel of vertex specular color.
        fB - float Blue channel of vertex specular color.