FieldAnimation Class
This class allows you to create and modify field animation objects.
See also
- A Unigine::FieldAnimation class to edit animation fields by using C++ API.
- A set of samples located in the data/samples/fields/ folder:
- animation_00
- animation_01
FieldAnimation Class
This class inherits from FieldMembers
FieldAnimation (vec3 size)
Creates a new field animation node of the specified size:- If the field animation is of an ellipse shape, its radius values along the axes must be specified.
- Otherwise, dimensions of the cube must be specified.
Arguments
- vec3 size - A size of the field animation along X, Y and Z axes in units.
float getAttenuation ()
Returns the current attenuation coefficient for the field animation that indicates how much animation attenuates starting from the center of the animation field to its edges:- By the minimum value of 0, no animation will be visible.
- The higher the value, the more intensive animation will be at the edges of the animation field.
Return value
Attenuation coefficient value.float getLeaf ()
Returns the scale for the rotation angle of vegetation leaves inside the animation field. It scales the Leaf offset parameter of mesh_leaf_base material.Return value
Scale for the rotation angle of vegetation leaves.float getScale ()
Returns the scale for speed of vegetation swaying. It scales the Stem scale and Leaf scale parameters of mesh_stem_base, mesh_leaf_base and grass_base materials.Return value
Scale for speed of vegetation swaying.vec3 getSize ()
Returns the animation field size:- If the field animation is of an ellipse shape, its radius values along the axes will be returned.
- Otherwise, dimensions of the cube will be returned.
Return value
The current animation field size along the X, Y and Z axes in units.float getStem ()
Returns the scale for movement amplitude of grass and vegetation stems inside the animation field. It scales the Stem offset parameter of mesh_stem_base, mesh_leaf_base and grass_base materials.Return value
Scale for movement amplitude of grass and vegetation stems.vec3 getWind ()
Returns the wind coefficients values that defines wind direction inside the animation field.Return value
Wind coefficients values along the X, Y and Z directions.int isEllipse ()
Returns the value indicating if the field animation is of an ellipse shape.Return value
1 if the field animation is of an ellipse shape, otherwise - 0.void setAttenuation (float attenuation)
Sets an attenuation coefficient value for the field animation that indicates how much animation attenuates starting from the center of the animation field to its edges:- By the minimum value of 0, no animation will be visible.
- The higher the value, the more intensive animation will be at the edges of the animation field.
Arguments
- float attenuation - An attenuation coefficient value. If a too small value is provided, 1E-6 will be used instead.
void setEllipse (int ellipse)
Transforms a cubical field animation into an ellipse-shaped one or vise versa.Arguments
- int ellipse - 1 for the ellipse-shaped field animation, 0 for the cubical one.
void setLeaf (float leaf)
Sets a scale for the rotation angle of vegetation leaves inside the animation field. It scales the Leaf offset parameter of mesh_leaf_base material.Arguments
- float leaf - Scale for the rotation angle of vegetation leaves. If a negative value is provided, 0 will be used instead.
void setScale (float scale)
Sets a scale for speed of vegetation swaying. It scales the Stem scale and Leaf scale parameters of mesh_stem_base, mesh_leaf_base and grass_base materials.Arguments
- float scale - Scale for speed of vegetation swaying.. If a negative value is provided, 0 will be used instead.
void setSize (vec3 size)
Sets an animation field size:- If the field animation is of an ellipse shape, its radius values along the axes must be set.
- Otherwise, dimensions of the cube must be set.
Arguments
- vec3 size - A new animation field size along the X, Y and Z axes in units. If a negative value is provided, 0 will be used instead.
void setStem (float stem)
Sets a scale for movement amplitude of grass and vegetation stems inside the animation field. It scales the Stem offset parameter of mesh_stem_base, mesh_leaf_base and grass_base materials.Arguments
- float stem - Scale for movement amplitude of grass and vegetation stems. If a negative value is provided, 0 will be used instead.
void setWind (vec3 wind)
Sets wind coefficients values that defines wind direction inside the animation field.Arguments
- vec3 wind - Wind coefficients values along the X, Y and Z directions.
Last update: 2017-07-03
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)