Unigine::ObjectWater Class
Interface for object water handling.
To use this class, include the UnigineObjectWater.h file.
Unigine::ObjectWater Class
Members
static int type ()
ObjectWater type.Return value
ObjectWater type identifier.static Ptr< ObjectWater > create (const NodePtr & node)
ObjectWater constructor.Arguments
- const NodePtr & node - Node smart pointer.
static Ptr< ObjectWater > create (const ObjectPtr & object)
ObjectWater constructor.Arguments
- const ObjectPtr & object - Object smart pointer.
static Ptr< ObjectWater > create ()
ObjectWater constructor.virtual void setFieldMask (int mask) const =0
Sets a field mask specifying the area of the Field node to be applied.Arguments
- int mask - An integer value, each bit of which is used to set a mask.
virtual int getFieldMask () const =0
Returns the mask specifying the area of the Field node to be applied.Return value
The integer value, each bit of which is used to set a mask.virtual void setWave (int num, const vec4 & wave) const =0
Sets parameters of one of four simulated water waves.Arguments
- int num - Wave number in range [0;3].
- const vec4 & wave - Wave parameters:
- The x and y components contain the velocity of the wave.
- The z component contains the frequency.
- The w component contains the amplitude.
virtual vec4 getWave (int num) const =0
Returns parameters of one of four simulated water waves.Arguments
- int num - Wave number in range [0;3].
Return value
Wave parameters:- The x and y components contain the velocity of the wave.
- The z component contains the frequency.
- The w component contains the amplitude.
virtual void setWaveAngle (int num, float angle) const =0
Sets direction (angle of spreading) for a given wave.Arguments
- int num - Wave number in range [0;3].
- float angle - Angle in degrees. Both positive and negative values are acceptable.
virtual float getWaveAngle (int num) const =0
Returns direction (angle of spreading) of a given wave.Arguments
- int num - Wave number in range [0;3].
Return value
Angle in degrees.virtual void setWaveSpeed (int num, float speed) const =0
Sets a speed of a given wave. The higher the value is, the faster waves follow each other.Arguments
- int num - Wave number in range [0;3].
- float speed - Speed in units per second.
virtual float getWaveSpeed (int num) const =0
Returns the speed of a given wave. The higher the value is, the faster waves follow each other.Arguments
- int num - Wave number in range [0;3].
Return value
Speed in units per second.virtual void setWaveLength (int num, float length) const =0
Sets the distance between successive crests of the wave. The higher the length value is, the broader the waves are.Arguments
- int num - Wave number in range [0;3].
- float length - Length in units.
virtual float getWaveLength (int num) const =0
Returns the distance between successive crests of the wave. The higher the length value is, the broader the waves are.Arguments
- int num - Wave number in range [0;3].
Return value
Length in units.virtual void setWaveHeight (int num, float height) const =0
Sets the distance between the highest and the lowest wave peaks. It sets the wave form together with the ObjectWater::setWaveLength() function. The higher the value is, the higher the waves are.Arguments
- int num - Wave number in range [0;3].
- float height - Height in units.
virtual float getWaveHeight (int num) const =0
Returns the distance between the highest and the lowest wave peaks. The higher the value is, the higher the waves are.Arguments
- int num - Wave number in range [0;3].
Return value
Height in units.virtual float getHeight (const UNIGINE_VEC3 & position) const =0
Returns a height offset of a given point relative to the water surface.Arguments
- const UNIGINE_VEC3 & position - Point position coordinates.
Return value
Height offset of the point.virtual vec3 getNormal (const UNIGINE_VEC3 & position) const =0
Returns a normal vector of a given point (to orient objects along the waves normals).Arguments
- const UNIGINE_VEC3 & position - Point position coordinates.
Return value
Normal vector.Last update: 03.07.2017
Помогите сделать статью лучше
Была ли эта статья полезной?
(или выберите слово/фразу и нажмите Ctrl+Enter