WaterOptions constructor
WaterOptions({
- int color = 0xffffff,
- int textureWidth = 512,
- int textureHeight = 512,
- double clipBias = 0.0,
- Map<
String, dynamic> ? shader, - double scale = 1,
- double flowSpeed = 0.03,
- double reflectivity = 0.02,
- Vector2? flowDirection,
- dynamic flowMap,
- FutureOr<
Texture?> ? normalMap0, - FutureOr<
Texture?> ? normalMap1, - bool inclusiveOnly = false,
- List<
Object3D> ? includeInReflection,
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.inclusiveOnly = false,
List<Object3D>? includeInReflection,
}){
this.includeInReflection = includeInReflection ?? [];
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');
}