Class SFMatrix3fObject

    • Constructor Detail

      • SFMatrix3fObject

        public SFMatrix3fObject()
        Constructor for SFMatrix3fObject performs value initialization.
      • SFMatrix3fObject

        public SFMatrix3fObject​(SFMatrix3fObject newValue)
        Constructor to copy an SFMatrix3fObject value as initial value for this new field object.
        Parameters:
        newValue - The newValue to apply
      • SFMatrix3fObject

        public SFMatrix3fObject​(float[] newValue)
        Constructor for SFMatrix3fObject using a corresponding Java primitive float[] array as new initial value.
        Parameters:
        newValue - is new value to assign Warning: newValue array length must correspond to tuple size for base type SFMatrix3f tuple size of 9. setContainerFieldOverride(containerFieldName); // apply checksConcreteField#getTupleSize(String)
    • Method Detail

      • equals

        public boolean equals​(SFMatrix3fObject comparisonSFMatrix3fObject)
        Determine whether two objects contain equal values.
        Parameters:
        comparisonSFMatrix3fObject - field type to compare
        Returns:
        true if equivalent, false otherwise
      • validate

        public final java.lang.String validate()
        Validate current value via get/set comparison tests
        Returns:
        empty string if get/set testing passes, warning otherwise
        See Also:
        validate(), validateRegex()
      • matches

        public static final boolean matches​(java.lang.String value)
        Test PATTERN match with regular expression (regex) of provided value.
        Parameters:
        value - String to check against regex pattern for successful match
        Returns:
        true if PATTERN matches, false otherwise
        See Also:
        REGEX, PATTERN, matches(), matches(String), validate(), java.util.regex.Pattern
      • setValueByString

        public SFMatrix3fObject setValueByString​(java.lang.String newValue)
                                          throws InvalidFieldValueException
        Utility accessor for SFMatrix3fObject using String value (which must pass parsing validation checks).

        Warning: this method is not type safe at compile time! Best practice for X3DJSAIL programmers is to use strongly typed methods instead, in order to avoid potential for run-time errors.
        Parameters:
        newValue - is new value to assign, if empty then assign DEFAULT_VALUE
        Returns:
        MFMatrix4dObject - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same node object).
        Throws:
        InvalidFieldValueException
        See Also:
        X3DLoaderDOM.toX3dObjectTree(org.w3c.dom.Node)
      • toString

        public static java.lang.String toString​(float[] value)
        Static utility method to provide String representation of a correctly typed input value.
        Parameters:
        value - The value to convert to a String
        Returns:
        String version of the provided value, with trailing zeroes and decimal points omitted.
        See Also:
        X3D Tooltips: type, SFFloatObject.stripTrailingZeroes(float)
      • getPrimitiveValue

        public float[] getPrimitiveValue()
        Provides current value of the field as a Java primitive type.
        Returns:
        current value
      • setValue

        public SFMatrix3fObject setValue​(float[] newValue)
        Apply an array of primitive values to this field.
        Parameters:
        newValue - The newValue to apply
        Returns:
        SFMatrix3fObject - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
      • setIdentity

        public void setIdentity()
        Specified by:
        setIdentity in interface Matrix3
      • set

        public void set​(int row,
                        int column)
        Specified by:
        set in interface Matrix3
      • get

        public float get​(int row,
                         int column)
        Specified by:
        get in interface Matrix3
      • toFloatArray

        public float[] toFloatArray()
        Provide float array for this field type.
        Returns:
        Array of floats in this field array.
      • setValue

        public SFMatrix3fObject setValue​(SFMatrix3fObject newValue)
        Apply an SFMatrix3fObject value to this field.
        Parameters:
        newValue - The newValue to apply
        Returns:
        SFMatrix3fObject - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
      • multiply

        public SFMatrix3fObject multiply​(float scaleFactor)
        Multiply scaleFactor times all values in this field type.
        Parameters:
        scaleFactor - scalar value for vector multiplication
        Returns:
        SFMatrix3fObject - namely this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
      • isDefaultValue

        public boolean isDefaultValue()
        Determine whether current value matches DEFAULT_VALUE
        Returns:
        whether current value matches DEFAULT_VALUE
        See Also:
        DEFAULT_VALUE