# DistanceDisplayConditionGeometryInstanceAttribute

#### new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(near, far)
Core/DistanceDisplayConditionGeometryInstanceAttribute.js 45

  Value and type information for per-instance geometry attribute that determines if the geometry instance has a distance display condition.

  Name | Type | Default | Description
  --- | --- | --- | ---
  `near` | Number | `0.0` | optional The near distance.
  `far` | Number | `Number.MAX_VALUE` | optional The far distance.

  ##### Throws:

  - DeveloperError : far must be greater than near.

  ##### Example:

      var instance = new Cesium.GeometryInstance({
        geometry : new Cesium.BoxGeometry({
          vertexFormat : Cesium.VertexFormat.POSITION_AND_NORMAL,
          minimum : new Cesium.Cartesian3(-250000.0, -250000.0, -250000.0),
          maximum : new Cesium.Cartesian3(250000.0, 250000.0, 250000.0)
        }),
        modelMatrix : Cesium.Matrix4.multiplyByTranslation(Cesium.Transforms.eastNorthUpToFixedFrame(
          Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883)), new Cesium.Cartesian3(0.0, 0.0, 1000000.0), new Cesium.Matrix4()),
        id : 'box',
        attributes : {
          show : new Cesium.DistanceDisplayConditionGeometryInstanceAttribute(100.0, 10000.0)
        }
      });

  ##### See:

  - GeometryInstance
  - GeometryInstanceAttribute

### Members

#### readonlycomponentDatatype : ComponentDatatype
Core/DistanceDisplayConditionGeometryInstanceAttribute.js 77

  The datatype of each component in the attribute, e.g., individual elements in `DistanceDisplayConditionGeometryInstanceAttribute#value`.
  Default Value: ``ComponentDatatype.FLOAT``

#### readonlycomponentsPerAttribute : Number
Core/DistanceDisplayConditionGeometryInstanceAttribute.js 93

  The number of components in the attributes, i.e., `DistanceDisplayConditionGeometryInstanceAttribute#value`.
  Default Value: `3`

#### readonlynormalize : Boolean
Core/DistanceDisplayConditionGeometryInstanceAttribute.js 111

  When `true` and `componentDatatype` is an integer format, indicate that the components should be mapped to the range [0, 1] (unsigned) or [-1, 1] (signed) when they are accessed as floating-point for rendering.
  Default Value: `false`

#### value : Float32Array
Core/DistanceDisplayConditionGeometryInstanceAttribute.js 62

  The values for the attributes stored in a typed array.
  Default Value: `[0.0, 0.0, Number.MAX_VALUE]`

### Methods

#### staticCesium.DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(distanceDisplayCondition) → DistanceDisplayConditionGeometryInstanceAttribute
Core/DistanceDisplayConditionGeometryInstanceAttribute.js 134

  Creates a new `DistanceDisplayConditionGeometryInstanceAttribute` instance given the provided an enabled flag and `DistanceDisplayCondition`.

  Name | Type | Description
  --- | --- | ---
  `distanceDisplayCondition` | DistanceDisplayCondition | The distance display condition.

  ##### Returns:

  The new `DistanceDisplayConditionGeometryInstanceAttribute` instance.

  ##### Throws:

  - DeveloperError : distanceDisplayCondition.far must be greater than distanceDisplayCondition.near

  ##### Example:

      var instance = new Cesium.GeometryInstance({
        geometry : geometry,
        attributes : {
          color : Cesium.DistanceDisplayConditionGeometryInstanceAttribute.fromDistanceDisplayCondition(distanceDisplayCondition),
        }
      });

#### staticCesium.DistanceDisplayConditionGeometryInstanceAttribute.toValue(distanceDisplayCondition, result) → Float32Array
Core/DistanceDisplayConditionGeometryInstanceAttribute.js 158

  Converts a distance display condition to a typed array that can be used to assign a distance display condition attribute.

  Name | Type | Description
  --- | --- | ---
  `distanceDisplayCondition` | DistanceDisplayCondition | The distance display condition value.
  `result` | Float32Array | optional The array to store the result in, if undefined a new instance will be created.

  ##### Returns:

  The modified result parameter or a new instance if result was undefined.

  ##### Example:

      var attributes = primitive.getGeometryInstanceAttributes('an id');
      attributes.distanceDisplayCondition = Cesium.DistanceDisplayConditionGeometryInstanceAttribute.toValue(distanceDisplayCondition, attributes.distanceDisplayCondition);