Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
0.8.3:water [2022/04/25 11:33] – [Water Material] admin | 0.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: | ||
+ | |||
+ | <file pascal> | ||
+ | procedure TForm1.doOnViewportMouseUp(ASender : TObject; AButton : TMouseButton; | ||
+ | AShift : TShiftState; | ||
+ | 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, | ||
+ | GorillaWaterMaterialSource1.AddRipple(Point3D(LPt3D.X, | ||
+ | end; | ||
+ | end; | ||
+ | </ | ||
===== Example ===== | ===== Example ===== | ||