update method
dynamic
update(
- dynamic frameTime,
- dynamic elapsedTime
)
override
Implementation
@override
// only need to do once as all share
update(frameTime, elapsedTime)
{
for (var idx=0; idx<_waterVertData.length; idx++) {
var vd=_waterVertData[idx];
/// _waterVertData.forEach((vd, idx) => {
var y = vd['initH']+ math.sin( elapsedTime +
vd['phase']) * vd['amplitude'];
g.attributes['position'].setY(idx, y);
//print("hrrr");
// });
}
g.attributes['position'].needsUpdate = true;
g.computeVertexNormals();
}