setProperty method

  1. @override
Camera setProperty(
  1. String propertyName,
  2. dynamic value, [
  3. int? offset
])
override

Implementation

@override
Camera setProperty(String propertyName, dynamic value, [int? offset]){
  if(propertyName == 'fov'){
    fov = value.toDouble();
  }
  else if(propertyName == 'zoom'){
    zoom = value.toDouble();
  }
  else if(propertyName == 'near'){
    near = value.toDouble();
  }
  else if(propertyName == 'far'){
    far = value.toDouble();
  }
  else if(propertyName == 'focus'){
    focus = value.toDouble();
  }
  else if(propertyName == 'aspect'){
    aspect = value.toDouble();
  }
  else if(propertyName == 'filmGauge'){
    filmGauge = value.toDouble();
  }
  else if(propertyName == 'left'){
    left = value.toDouble();
  }
  else if(propertyName == 'right'){
    right = value.toDouble();
  }
  else if(propertyName == 'top'){
    top = value.toDouble();
  }
  else if(propertyName == 'bottom'){
    bottom = value.toDouble();
  }
  else if(propertyName == view){
    if(value is Map<String,dynamic>){
      view = CameraView.fromJson(value);
      return this;
    }
    view = value;
  }
  else if(propertyName == 'coordinateSystem'){
    coordinateSystem = value.toInt();
  }
  else if(propertyName == 'viewport'){
    if(value is List){
      viewport = Vector4().copyFromUnknown(value);
      return this;
    }
    viewport = value;
  }
  else if(propertyName == 'matrixWorldInverse'){
    if(value is List){
      matrixWorldInverse = Matrix4().copyFromUnknown(value);
      return this;
    }
    matrixWorldInverse = value;
  }
  else if(propertyName == 'projectionMatrix'){
    if(value is List){
      projectionMatrix = Matrix4().copyFromUnknown(value);
      return this;
    }
    projectionMatrix = value;
  }
  else if(propertyName == 'projectionMatrixInverse'){
    if(value is List){
      projectionMatrixInverse = Matrix4().copyFromUnknown(value);
      return this;
    }
    projectionMatrixInverse = value;
  }
  else{
    super.setProperty(propertyName, value);
  }
  return this;
}