WaterOptions constructor

WaterOptions({
  1. int color = 0xffffff,
  2. int textureWidth = 512,
  3. int textureHeight = 512,
  4. double clipBias = 0.0,
  5. Map<String, dynamic>? shader,
  6. double scale = 1,
  7. double flowSpeed = 0.03,
  8. double reflectivity = 0.02,
  9. Vector2? flowDirection,
  10. dynamic flowMap,
  11. FutureOr<Texture?>? normalMap0,
  12. FutureOr<Texture?>? normalMap1,
})

Implementation

WaterOptions({
  this.color = 0xffffff,
  this.textureWidth = 512,
  this.textureHeight = 512,
  this.clipBias = 0.0,
  Map<String,dynamic>? shader,
  this.scale = 1,
  this.flowSpeed = 0.03,
  this.reflectivity = 0.02,
  Vector2? flowDirection,
  this.flowMap,
  FutureOr<Texture?>? normalMap0,
  FutureOr<Texture?>? normalMap1
}){
  this.shader = shader ?? Water.waterShader;
  this.flowDirection = flowDirection ?? Vector2( 1, 0 );

  final textureLoader = TextureLoader();
  this.normalMap0 = normalMap0 ?? textureLoader.fromAsset( 'assets/Water_1_M_Normal.jpg',package: 'three_js_objects');
  this.normalMap1 = normalMap1 ?? textureLoader.fromAsset( 'assets/Water_2_M_Normal.jpg',package: 'three_js_objects');
}