Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
0.8.3:water [2022/04/25 11:33] – [Water Material] admin0.8.3:water [2022/04/25 11:36] (current) – [Ripples] admin
Line 111: Line 111:
 |RippleDecay|Get or set decay value for ripples. Simply said: It defines how fast a ripple will end.| |RippleDecay|Get or set decay value for ripples. Simply said: It defines how fast a ripple will end.|
  
 +To add a ripple at a certain position use the TGorillaWaterMaterialSource.AddRipple() method.
  
 +__Warning:__ The number of ripples is currently hardcoded limited to 32.
 +
 +<file pascal>
 +procedure TForm1.doOnViewportMouseUp(ASender : TObject; AButton : TMouseButton;
 +  AShift : TShiftState; X, Y : Single);
 +var LPt3D : TPoint3D;
 +begin
 +  /// add a ripple by clicking with the left mouse button onto the water plane (Caution: HitTest needs to be activated)
 +  if (ssLeft in fShiftState) then
 +  begin
 +    LPt3D := GorillaViewport1.ScreenToWorld(PointF(X, Y));
 +    GorillaWaterMaterialSource1.AddRipple(Point3D(LPt3D.X, LPt3D.Z, -LPt3D.Y));
 +  end;
 +end;
 +</file>
 ===== Example ===== ===== Example =====