Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Water2: Fix the error when flowSpeed and other parameters are 0. #27536

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions examples/jsm/objects/Water2.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ class Water extends Mesh {
const scope = this;

const color = ( options.color !== undefined ) ? new Color( options.color ) : new Color( 0xFFFFFF );
const textureWidth = options.textureWidth || 512;
const textureHeight = options.textureHeight || 512;
const clipBias = options.clipBias || 0;
const flowDirection = options.flowDirection || new Vector2( 1, 0 );
const flowSpeed = options.flowSpeed || 0.03;
const reflectivity = options.reflectivity || 0.02;
const scale = options.scale || 1;
const shader = options.shader || Water.WaterShader;
const textureWidth = options.textureWidth !== undefined ? options.textureWidth : 512;
const textureHeight = options.textureHeight !== undefined ? options.textureHeight : 512;
const clipBias = options.clipBias !== undefined ? options.clipBias : 0;
const flowDirection = options.flowDirection !== undefined ? options.flowDirection : new Vector2( 1, 0 );
const flowSpeed = options.flowSpeed !== undefined ? options.flowSpeed : 0.03;
const reflectivity = options.reflectivity !== undefined ? options.reflectivity : 0.02;
const scale = options.scale !== undefined ? options.scale : 1;
const shader = options.shader !== undefined ? options.shader : Water.WaterShader;

const textureLoader = new TextureLoader();

Expand Down