Triton
Visual simulation library for ocean rendering.
Ocean.h
Go to the documentation of this file.
1// Copyright (c) 2011-2021 Sundog Software, LLC. All rights reserved worldwide.
2
3#ifndef TRITON_OCEAN_H
4#define TRITON_OCEAN_H
5
10#ifdef SWIG
11#define TRITONAPI
12%module TritonOcean
13%include "carrays.i"
14%include "cpointer.i"
15%import "Environment.h"
16%pointer_functions(float, floatp);
17%array_functions( double, double_array )
18SWIG_CSBODY_PROXY(public, public, SWIGTYPE)
19SWIG_CSBODY_TYPEWRAPPER(public, public, public, SWIGTYPE)
20%{
21#include "Ocean.h"
22using namespace Triton;
23%}
24#endif
25
26#include "Environment.h"
27#include "WakeGenerator.h"
28#include "RotorWash.h"
29#include "TidalStreamWake.h"
30
31#pragma pack(push)
32#pragma pack(8)
33
34namespace Triton
35{
36class ProjectedGrid;
37class WakeManager;
38class ParticleSystemManager;
39class SprayManager;
40class DecalManager;
41class Mutex;
42class GodRays;
43class Camera;
44class WaterModelInitializationParams;
45class ComplexNumber;
46
49 TESSENDORF,
53};
54
56enum Shaders {
57 WATER_SURFACE
58 , WATER_SURFACE_PATCH
59 , SPRAY_PARTICLES
60 , WAKE_SPRAY_PARTICLES
61 , GOD_RAYS
62 , WATER_DECALS
63};
64
67 GOOD,
68 BETTER,
69 BEST
70};
71
73class TritComplex : public MemObject
74{
75public:
76 float real, imaginary;
77};
78
80class Ocean : public MemObject
81{
82public:
108 static Ocean * TRITONAPI Create(Environment *env, WaterModelTypes type = JONSWAP, bool enableHeightTests = false,
109 bool enableBreakingWaves = false, OceanQuality quality = GOOD);
110
111#ifndef SWIG
143 static Ocean * TRITONAPI Create(Environment *env, const TRITON_VECTOR(unsigned int)& userShaders, WaterModelTypes type = JONSWAP,
144 bool enableHeightTests = false, bool enableBreakingWaves = false, OceanQuality quality = GOOD);
145#endif
146
148 virtual ~Ocean();
149
182 virtual void TRITONAPI Draw(double time, bool depthWrites = true, bool drawWater = true, bool drawParticles = true, void* context = 0, const Camera* camera = 0);
183
184
226 virtual void TRITONAPI DrawConcurrent(double time, bool depthWrites = true, bool drawWater = true, bool drawParticles = true, void* context = 0, const Camera* camera = 0);
227
232 void TRITONAPI PostDrawConcurrent();
233
294 virtual bool TRITONAPI SetPatchShader(double time, int vertexStride, int positionOffset, bool doublePrecisionVertices,
295 const double *modelMatrix = 0, bool decalPass = false, void* context = 0, const Camera* camera = 0);
296
310 virtual bool TRITONAPI SetPatchMatrix(const double *modelMatrix, void* context = 0, const Camera* camera = 0);
311
329 virtual void TRITONAPI UnsetPatchShader(double time = 0.0, const TBoundingBox* patchBounds = 0, bool decalPass = false, void* context = 0, const Camera* camera = 0);
330
331#ifndef SWIG
338 virtual bool ReloadShaders(const TRITON_VECTOR(unsigned int)& shaders, bool reloadSurface = true,
339 bool reloadWakes = true, bool reloadSprays = true, bool reloadDecals = true, bool reloadGodRays = true);
340#endif
341
344 virtual bool Initialize(void* context, const Camera* camera);
345
363 virtual void TRITONAPI UpdateSimulation(double time, const Camera* camera = 0);
364
368 void TRITONAPI D3D9DeviceLost();
369
372 void TRITONAPI D3D9DeviceReset();
373
375 float TRITONAPI GetChoppiness() const;
376
382 void TRITONAPI SetChoppiness(float chop);
383
385 float TRITONAPI GetLoopingPeriod() const;
386
393 void TRITONAPI SetLoopingPeriod(float loopingPeriod);
394
404 float TRITONAPI GetDepth(Triton::Vector3& floorNormal, const Camera* camera = 0) const;
405
423 void TRITONAPI SetDepth(float depth, const Triton::Vector3& floorNormal, const Camera* camera = 0);
424
428 void TRITONAPI EnableWireframe(bool wireframeOn);
429
432 const char * TRITONAPI GetFFTName() const;
433
435 unsigned int TRITONAPI GetNumTriangles() const;
436
467 ShaderHandle TRITONAPI GetShaderObject(Shaders shaderProgram, void* context = 0, const Camera* camera = 0) const;
468
469 // Retrives the underlying WakeManager. For internal use only.
470 WakeManager * TRITONAPI GetWakeManager() {
471 return wakeManager;
472 }
473
474 // Retrieves the underlying DecalManager. For internal use only.
475 DecalManager * TRITONAPI GetDecalManager() {
476 return decalManager;
477 }
478
492 DecalHandle TRITONAPI AddDecal(TextureHandle texture, float size, const Vector3& position);
493
499 void TRITONAPI ScaleDecal(DecalHandle decal, float scaleWidth, float scaleDepth);
500
502 void TRITONAPI MoveDecal(DecalHandle decal, const Vector3& position);
503
508 void TRITONAPI RotateDecal(DecalHandle decal, double radians);
509
514 void TRITONAPI SetDecalAlpha(DecalHandle decal, float alpha);
515
517 void TRITONAPI RemoveDecal(DecalHandle decal);
518
563 bool TRITONAPI GetHeight(const Vector3& point, const Vector3& direction, float& height, Vector3& normal,
564 bool visualCorrelation = true, bool includeWakes = true, bool highResolution = true,
565 bool threadSafe = true, Vector3 *intersectionPoint = 0, bool autoFlip = true, const Camera* camera = 0);
566
567#ifndef SWIG
621 bool TRITONAPI GetBatchHeight(const TRITON_VECTOR(Vector3) points, const TRITON_VECTOR(Vector3) directions, TRITON_VECTOR(float)& heights,
622 TRITON_VECTOR(Vector3)& normals, TRITON_VECTOR(Vector3)& intersectionPoints,
623 bool visualCorrelation = true, bool includeWakes = true, bool highResolution = true,
624 bool threadSafe = true, bool autoFlip = true, const Camera* camera = 0);
625#endif
626
661 bool TRITONAPI GetWavesIntersection(const Vector3& point, const Vector3& direction, Vector3& normal, Vector3& intersectionPoint,
662 double precision = 0.1, bool visualCorrelation = true, bool threadSafe = true,
663 const Camera* camera = 0);
664
675 bool TRITONAPI GetIntersection(const Vector3& point, const Vector3& direction, Vector3& intersection, const Camera* camera = 0);
676
679 float TRITONAPI GetWaveHeading() const {
680 return waveHeading;
681 }
682
686 void TRITONAPI EnableSpray(bool enable);
687
690 bool TRITONAPI SprayEnabled() const {
691 return sprayEnabled;
692 }
693
698 void TRITONAPI SetRefractionColor(const Vector3& refractionColor);
699
704 const Vector3& TRITONAPI GetRefractionColor() const;
705
708 void TRITONAPI SetReflectionScale(float reflectionScale);
709
711 float TRITONAPI GetReflectionScale() const;
712
716 void TRITONAPI SetPlanarReflectionBlend(float blendPercent);
717
719 float TRITONAPI GetPlanarReflectionBlend() const;
720
744 bool TRITONAPI ComputeReflectionMatrices(Matrix4& reflectionMatrix, Matrix3& textureMatrix, const Camera* camera = 0);
745
747 const Environment * TRITONAPI GetEnvironment() const {
748 return environment;
749 }
750
753 virtual bool TRITONAPI IsCameraAboveWater(const Camera* camera = 0);
754
759 void TRITONAPI SetDepthOffset(float offset);
760
762 float TRITONAPI GetDepthOffset() const;
763
765 void TRITONAPI SetDisplacementDampingDistance(double distance);
766
768 double TRITONAPI GetDisplacementDampingDistance() const;
769
773 void TRITONAPI EnableGodRays(bool enable) {
774 enableGodRays = enable;
775 }
776
778 bool TRITONAPI GodRaysEnabled() const {
779 return godRays != 0 && enableGodRays;
780 }
781
783 void TRITONAPI SetGodRaysFade(float fadeAmount);
784
786 float TRITONAPI GetGodRaysFade() const;
787
792 void TRITONAPI Lock();
793
795 void TRITONAPI Unlock();
796
800 void TRITONAPI SetQuality(OceanQuality quality);
801
803 OceanQuality TRITONAPI GetQuality() const {
804 return quality;
805 }
806
809 void TRITONAPI SetLinearColorSpace(bool linearOn);
810
812 bool TRITONAPI GetLinearColorSpace() const;
813
815 void TRITONAPI SetMaximumWavePeriod(double maxPeriod);
816
818 double TRITONAPI GetMaximumWavePeriod() const;
819
823 void TRITONAPI SetClipDistances(double nearClip, double farClip);
824
827 void TRITONAPI GetClipDistances(double& nearClip, double& farClip) const;
828
857 bool TRITONAPI OverrideFFTInputArray(const TritComplex *H0, unsigned int size);
858
860 void TRITONAPI ClearFFTInputArray();
861
863 void TRITONAPI SetRotorWashUseDecals(bool useDecals);
864 bool TRITONAPI GetRotorWashUseDecals(void) const;
865
869 void TRITONAPI SetWaterModel(WaterModelTypes waterModel);
870
872 WaterModelTypes TRITONAPI GetWaterModel(void) const;
873
874 // Wrappers for interpreted languages require a publicly declared default constructor. You should always use Ocean::Create, however.
875 Ocean() {}
876
877#ifndef SWIG
878
879 // Used internally
880 void RegisterWakeGenerator(WakeGenerator* wg);
881 void UnregisterWakeGenerator(WakeGenerator *wg);
882 void RegisterRotorWash(RotorWash *rw);
883 void UnregisterRotorWash(RotorWash *rw);
884 void RegisterTidalStreamWake(TidalStreamWake *tsw);
885 void UnregisterTidalStreamWake(TidalStreamWake *tsw);
886 void EnvironmentDeleted();
887 void NotifySwellsChanged();
888 void SetConfused(bool);
889 void UpdateHeightMap(void* context, const Camera* camera, TextureHandle heightMap, const Matrix4& heightMapMatrix);
890 GodRays *GetGodRays() const { return godRays; }
891 const TRITON_VECTOR(unsigned int)& GetUserShaders() const {return userShaders;}
892 ProjectedGrid* GetProjectedGrid() const {return grid;}
893
894 typedef void(*GETOCEANHEIGHTPROC)(const Vector3& point, Vector3& normal, float& height);
895
896 void TRITONAPI SetOceanHeightCB(GETOCEANHEIGHTPROC _oceanHeightCB) {
897 oceanHeightCB = _oceanHeightCB;
898 }
899
900 GETOCEANHEIGHTPROC TRITONAPI GetOceanHeightCB() const {
901 return oceanHeightCB;
902 }
903
904protected:
905 Ocean(Environment *env, WaterModelTypes type, bool enableHeightTest, bool enableBreakingWaves, OceanQuality quality);
906 Ocean(Environment *env, WaterModelTypes type, bool enableHeightTest, bool enableBreakingWaves, OceanQuality quality, const TRITON_VECTOR(unsigned int)& userShaders);
907 virtual void Initialize(const Environment *env, WaterModelTypes type, bool enableHeightTest, bool enableBreakingWaves);
908
909 virtual bool CreateWaterSimulation();
910 void DestroyWaterSimulation();
911
912 void SetWaveHeading(const Camera* camera);
913
914 void DrawInternal(double time, bool depthWrites, bool drawWater, bool drawParticles, void* context, const Camera* camera, bool respectThreadSafe, bool respectAvoidStalls);
915
916 bool isGlobal, initialized, heightReadsEnabled, enableGodRays;
917
918 Environment *environment;
919
920 ProjectedGrid *grid;
921
922 WakeManager *wakeManager;
923
924 SprayManager *sprayManager;
925
926 DecalManager *decalManager;
927
928 GodRays *godRays;
929
930 float waveHeading;
931
932 bool sprayEnabled, enableKelvin;
933
934 double dampingDistance;
935
936 Mutex *mutex;
937
938 bool simulationUpdated;
939
940 WaterModelTypes waterModelType;
941
942 double lastUpdateTime;
943 const Camera* lastCamera;
944
945 double timeAdjustment;
946
947 TRITON_VECTOR(WakeGenerator *) wakeGenerators;
948
949 TRITON_VECTOR(RotorWash *) rotorWashes;
950
951 TRITON_VECTOR(TidalStreamWake *) tidalStreams;
952
953 TRITON_VECTOR(unsigned int) userShaders;
954
955 bool hasBreakingWaves, linearEnabled;
956
957 OceanQuality quality;
958
959 GETOCEANHEIGHTPROC oceanHeightCB;
960
961 WaterModelInitializationParams* watermodelparams;
962
963 double cameraMotionThreshold;
964
965 void createAndInitializeFallbackWaterModel(void);
966#endif //SWIG
967};
968}
969
970#pragma pack(pop)
971
972#endif
The public interface for setting Triton's environmental parameters.
Triton's Ocean model interface.
OceanQuality
Enumerates the ocean quality settings used in Ocean::SetQuality()
Definition: Ocean.h:66
WaterModelTypes
Enumerates the different water models available for simluating ocean waves.
Definition: Ocean.h:48
@ JONSWAP
An FFT-powered Pierson-Moskowitz wave spectrum.
Definition: Ocean.h:51
@ UNKNOWN_WATERMODEL
The most accurate wave model, which takes wind fetch length into account.
Definition: Ocean.h:52
@ PIERSON_MOSKOWITZ
Tessendorf's ocean wave model with the Phillips wave spectrum, using fast Fourier transforms to simul...
Definition: Ocean.h:50
Shaders
Enumerates the different shader programs used internally by Triton.
Definition: Ocean.h:56
An object that generates rotor wash wave and spray effects.
An object that generates a static wake wave in a given direction, such as that generated by a buoy in...
int ShaderHandle
A renderer-agnostic handle for a shader.
Definition: TritonCommon.h:54
void * DecalHandle
A renderer-agnostic handle for a decal.
Definition: TritonCommon.h:58
int TextureHandle
A renderer-agnostic handle for a texture.
Definition: TritonCommon.h:56
An object that generates a ship Kelvin wake as it moves.
Triton's public interface for specifying the camera properties.
Definition: Camera.h:37
Triton's public interface for specifying the environmental conditions and camera properties.
Definition: Environment.h:214
A simple 3x3 matrix class and its operations.
Definition: Matrix3.h:30
An implementation of a 4x4 matrix and some simple operations on it.
Definition: Matrix4.h:30
This base class for all Triton objects intercepts the new and delete operators, routing them through ...
Definition: MemAlloc.h:71
The Ocean class allows you to configure and draw Triton's water simulation.
Definition: Ocean.h:81
void TRITONAPI SetClipDistances(double nearClip, double farClip)
Tells Triton about the projected Z values at your near and far clipping planes.
static Ocean *TRITONAPI Create(Environment *env, const TRITON_VECTOR(unsigned int)&userShaders, WaterModelTypes type=JONSWAP, bool enableHeightTests=false, bool enableBreakingWaves=false, OceanQuality quality=GOOD)
Creates an Ocean instance tied to the given Environment, using additional user-supplied OpenGL shader...
bool TRITONAPI GetBatchHeight(const TRITON_VECTOR(Vector3) points, const TRITON_VECTOR(Vector3) directions, TRITON_VECTOR(float)&heights, TRITON_VECTOR(Vector3)&normals, TRITON_VECTOR(Vector3)&intersectionPoints, bool visualCorrelation=true, bool includeWakes=true, bool highResolution=true, bool threadSafe=true, bool autoFlip=true, const Camera *camera=0)
This is a batch version of Triton::Ocean::GetHeight(), which will avoid stalling the OpenGL pipeline ...
void TRITONAPI EnableGodRays(bool enable)
Turns the underwater crepuscular rays effect on or off.
Definition: Ocean.h:773
void TRITONAPI RemoveDecal(DecalHandle decal)
Removes a decal texture previously applied with AddDecal().
virtual bool TRITONAPI IsCameraAboveWater(const Camera *camera=0)
Returns whether the current camera position (from Environment::SetCameraMatrix()) is above the simula...
void TRITONAPI SetLinearColorSpace(bool linearOn)
Sets use of linear color space, in which the ocean color will be raised to the power of 2....
void TRITONAPI Unlock()
Explicitly locks the ocean's mutex previously locked by Ocean::Lock().
void TRITONAPI GetClipDistances(double &nearClip, double &farClip) const
Retrieves Triton's current assumptions about the projected Z values at your near and far clipping pla...
void TRITONAPI ClearFFTInputArray()
Stops using an overridden FFT wave input array as defined in Environment::OverrideFFTInputArray.
virtual void TRITONAPI DrawConcurrent(double time, bool depthWrites=true, bool drawWater=true, bool drawParticles=true, void *context=0, const Camera *camera=0)
Draws an infinite ocean surrounding the camera (as specified in the Environment object) for the simul...
void TRITONAPI ScaleDecal(DecalHandle decal, float scaleWidth, float scaleDepth)
Scales an existing decal in width and depth at runtime.
void TRITONAPI MoveDecal(DecalHandle decal, const Vector3 &position)
Moves an existing decal to the given location.
void TRITONAPI SetDepthOffset(float offset)
Applies a depth offset to the water, applied in the vertex program.
void TRITONAPI RotateDecal(DecalHandle decal, double radians)
Rotates an existing decal by the given amount in radians.
bool TRITONAPI SprayEnabled() const
Returns if spray particle effects on breaking waves are enabled, which they are by default.
Definition: Ocean.h:690
void TRITONAPI EnableSpray(bool enable)
Enables or disables spray particle effects on breaking waves.
float TRITONAPI GetDepthOffset() const
Retrieves the depth offset (if any) previously set via Triton::Ocean::SetDepthOffset(),...
bool TRITONAPI GetHeight(const Vector3 &point, const Vector3 &direction, float &height, Vector3 &normal, bool visualCorrelation=true, bool includeWakes=true, bool highResolution=true, bool threadSafe=true, Vector3 *intersectionPoint=0, bool autoFlip=true, const Camera *camera=0)
Retrieves the height and normal of the ocean surface at the intersection point of the given ray.
void TRITONAPI SetReflectionScale(float reflectionScale)
Scales the intensity of reflections on the water (environment, planar, and light reflections combined...
OceanQuality TRITONAPI GetQuality() const
Retrieve the current simulation quality setting, either set by Ocean::SetQuality() or the default val...
Definition: Ocean.h:803
float TRITONAPI GetChoppiness() const
Retrieves the choppiness setting of the Ocean, which controls how peaked the waves are.
virtual void TRITONAPI Draw(double time, bool depthWrites=true, bool drawWater=true, bool drawParticles=true, void *context=0, const Camera *camera=0)
Draws an infinite ocean surrounding the camera (as specified in the Environment object) for the simul...
void TRITONAPI SetQuality(OceanQuality quality)
Set a quality setting (GOOD, BETTER, or BEST.) Higher quality will result in finer wave resolution,...
bool TRITONAPI GetWavesIntersection(const Vector3 &point, const Vector3 &direction, Vector3 &normal, Vector3 &intersectionPoint, double precision=0.1, bool visualCorrelation=true, bool threadSafe=true, const Camera *camera=0)
Retrieves an intersection between a ray and the ocean surface, taking waves and wakes into account.
virtual bool TRITONAPI SetPatchMatrix(const double *modelMatrix, void *context=0, const Camera *camera=0)
If you are drawing many of your own water meshes using SetPatchShader() at once, it will be much fast...
void TRITONAPI SetRotorWashUseDecals(bool useDecals)
Toggle rotor wash decals at run time.
float TRITONAPI GetReflectionScale() const
Retrieves any reflection scale set previously by SetReflectionScale(), or 1.0 otherwise.
void TRITONAPI SetDepth(float depth, const Triton::Vector3 &floorNormal, const Camera *camera=0)
Sets the simulated depth of the water in world units at the camera position, and the slope of the sea...
bool TRITONAPI OverrideFFTInputArray(const TritComplex *H0, unsigned int size)
Explicitly overrides the H0 input array of wave amplitudes for given wavelengths and directions,...
static Ocean *TRITONAPI Create(Environment *env, WaterModelTypes type=JONSWAP, bool enableHeightTests=false, bool enableBreakingWaves=false, OceanQuality quality=GOOD)
Creates an Ocean instance tied to the given Environment, using the specified wave model.
void TRITONAPI EnableWireframe(bool wireframeOn)
Enables or disables wireframe rendering of the ocean's mesh.
virtual bool TRITONAPI SetPatchShader(double time, int vertexStride, int positionOffset, bool doublePrecisionVertices, const double *modelMatrix=0, bool decalPass=false, void *context=0, const Camera *camera=0)
Sets the shaders and state necessary for rendering a user-provided patch of geometry as water.
void TRITONAPI PostDrawConcurrent()
Method that must be called from the main thread after all Ocean::DrawConcurrent calls have completed ...
WaterModelTypes TRITONAPI GetWaterModel(void) const
Get the underlying water model.
const char *TRITONAPI GetFFTName() const
Returns a description of the FFT transform being used, if a FFT water model is active.
bool TRITONAPI GetLinearColorSpace() const
Gets whether linear color space rendering is enabled via SetLinearColorSpace().
virtual bool Initialize(void *context, const Camera *camera)
In OpenGL, this must be called with each set of context and camera that you intend to render with See...
const Vector3 &TRITONAPI GetRefractionColor() const
Returns the color of light refracted into the water.
float TRITONAPI GetGodRaysFade() const
Returns the god ray fading amount set in Ocean::FadeGodRays().
const Environment *TRITONAPI GetEnvironment() const
Retrieves the environment this ocean is attached to.
Definition: Ocean.h:747
void TRITONAPI SetRefractionColor(const Vector3 &refractionColor)
Modifies the color used for refracted light rays that go into deep water.
float TRITONAPI GetWaveHeading() const
Retrieves the wave direction.
Definition: Ocean.h:679
virtual void TRITONAPI UpdateSimulation(double time, const Camera *camera=0)
Updates the underlying wave simulation; calling this is optional and only necessary if you wish to pe...
bool TRITONAPI GetIntersection(const Vector3 &point, const Vector3 &direction, Vector3 &intersection, const Camera *camera=0)
Retrieves the intersection, if any, between a ray and the ocean surface.
unsigned int TRITONAPI GetNumTriangles() const
Returns the number of triangles rendered by the underlying projected grid.
float TRITONAPI GetPlanarReflectionBlend() const
Retrieves the current blend percentage for planar reflections.
void TRITONAPI SetGodRaysFade(float fadeAmount)
Fades out the underwater crepuscular rays effect by the specified amount (0 = no fading,...
void TRITONAPI Lock()
Explicitly locks the mutex used to ensure thread safety between the draw, update, and height query me...
void TRITONAPI SetDecalAlpha(DecalHandle decal, float alpha)
Sets a decal's alpha blending amount (default is 1.0.)
double TRITONAPI GetMaximumWavePeriod() const
Retrieves the maximum wave period enforced regardless of wind conditions requested.
DecalHandle TRITONAPI AddDecal(TextureHandle texture, float size, const Vector3 &position)
Applies a decal texture to the dynamic ocean surface, useful for effects involving films,...
virtual ~Ocean()
Virtual destructor.
virtual void TRITONAPI UnsetPatchShader(double time=0.0, const TBoundingBox *patchBounds=0, bool decalPass=false, void *context=0, const Camera *camera=0)
Restores the graphics state prior to a previous call to Ocean::SetPatchShader().
void TRITONAPI SetMaximumWavePeriod(double maxPeriod)
Sets a maximum wave period in the simulated wave spectra, irrespective of the wind conditions request...
void TRITONAPI SetPlanarReflectionBlend(float blendPercent)
Sets the prominence of planar reflections on this ocean surface, if one was set using Triton::Environ...
virtual bool ReloadShaders(const TRITON_VECTOR(unsigned int)&shaders, bool reloadSurface=true, bool reloadWakes=true, bool reloadSprays=true, bool reloadDecals=true, bool reloadGodRays=true)
OpenGL only: Reload the underlying shader programs, linking in a new list of user-supplied shader obj...
ShaderHandle TRITONAPI GetShaderObject(Shaders shaderProgram, void *context=0, const Camera *camera=0) const
Retrieves an underlying shader object used to render the water.
void TRITONAPI SetWaterModel(WaterModelTypes waterModel)
Change the water model at run time.
void TRITONAPI SetLoopingPeriod(float loopingPeriod)
Set the looping period of the Ocean, which define time after which wave simulation repeats.
void TRITONAPI SetChoppiness(float chop)
Set the choppiness of the waves, which controls how peaked the waves are.
void TRITONAPI D3D9DeviceReset()
DirectX9 users must call D3D9DeviceReset() in response to device resets done in response to lost devi...
void TRITONAPI D3D9DeviceLost()
DirectX9 users must call D3D9DeviceLost() in response to lost devices, prior to resetting the device.
float TRITONAPI GetDepth(Triton::Vector3 &floorNormal, const Camera *camera=0) const
Retrieves the simulated depth of the water in world units, and the surface normal of the sea floor,...
bool TRITONAPI GodRaysEnabled() const
Returns whether the underwater crepuscular rays effect is enabled.
Definition: Ocean.h:778
double TRITONAPI GetDisplacementDampingDistance() const
Retrieves the distance at which 3D wave displacements are dampened to prevent aliasing when moving th...
bool TRITONAPI ComputeReflectionMatrices(Matrix4 &reflectionMatrix, Matrix3 &textureMatrix, const Camera *camera=0)
A helper function for using planar reflections with Triton.
float TRITONAPI GetLoopingPeriod() const
Retrieves the looping period of the Ocean, which define time after which wave simulation repeats.
void TRITONAPI SetDisplacementDampingDistance(double distance)
Sets the distance at which 3D wave displacements are dampened to prevent aliasing when moving the cam...
A RotorWash object will generate spray and circular waves on the ocean surface in the direction it is...
Definition: RotorWash.h:37
An static wake pointing in a given direction at a fixed location, for example from a buoy or bridge p...
Definition: TidalStreamWake.h:35
A structure describing a complex number, for use in Environment::OverrideFFTInputArray.
Definition: Ocean.h:74
A 3D double-precision Vector class and its operations.
Definition: Vector3.h:36
A WakeGenerator represents an object on the water that generates a wake as it moves,...
Definition: WakeGenerator.h:132