/**
   * Get the value of a field. If the field is a primitive type, it will return a class representing
   * the value. For arrays or nodes it will return the instance directly.
   *
   * @param index The index of the field to change.
   * @return The class representing the field value
   * @throws InvalidFieldException The field index is not known
   */
  public VRMLFieldData getFieldValue(int index) throws InvalidFieldException {
    VRMLFieldData fieldData = fieldLocalData.get();

    switch (index) {
      case FIELD_ROTATION_CHANGED:
        fieldData.clear();
        fieldData.floatArrayValue = vfRotationChanged;
        fieldData.dataType = VRMLFieldData.FLOAT_ARRAY_DATA;
        fieldData.numElements = 1;
        break;

      case FIELD_OFFSET:
        fieldData.clear();
        fieldData.floatArrayValue = vfOffset;
        fieldData.dataType = VRMLFieldData.FLOAT_ARRAY_DATA;
        fieldData.numElements = 1;
        break;

      default:
        super.getFieldValue(index);
    }

    return fieldData;
  }