This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
Extending Editor Functionality
编程
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::TextureCurve Class

Header: #include <UnigineTextures.h>

Interface for handling curve textures. This class lets the user store 2d curves in a form of a texture (convert vectors to raster data).

Curve textures can be used for color variation in the particles_base material of Particle Systems or in other custom materials.

You can set up to 4 channels for the curve texture.

TextureCurve Class

Members


TextureCurve ( int num_channels, int resolution, int flags ) #

Sets resolution, number of channels and texture flags for this TextureCurve instance. The pointer to the curve texture is set to null and curves are marked for an update.

Arguments

  • int num_channels - Number of texture channels.
  • int resolution - Width resolution of the curve texture.
  • int flags - Texture flags.

TextureCurve ( const Ptr<TextureCurve> & texture_curve ) #

Curve texture constructor. Creates a new curve texture by copying a given source curve texture.

Arguments

  • const Ptr<TextureCurve> & texture_curve - Pointer to a new curve texture.

Ptr<Texture> getTexture ( ) const#

Creates a new texture and updates hashes for curves, if required. Returns a pointer to the texture or null if the texture was not created.

void releaseTexture ( ) #

Deletes the texture and its pointer.

void copy ( const Ptr<TextureCurve> & src_texture_curve ) #

Copies the curves data of a source texture to the texture.

Arguments

  • const Ptr<TextureCurve> & src_texture_curve - Source curve texture.

Ptr<TextureCurve> clone ( ) const#

Duplicates the curve texture and returns a pointer to the copy.

Ptr<Curve2d> getCurve ( int channel ) const#

Returns a pointer to the Curve2d for the specified channel.

Arguments

  • int channel - Required channel.

Return value

Pointer to a Curve2d object.

void setNumChannels ( int channels ) #

Sets the new number of channels for the texture.

Arguments

  • int channels - Number of texture channels.

int getNumChannels ( ) const#

Returns the number of texture channels.

void setResolution ( int resolution ) #

Sets the width resolution for the texture.

Arguments

  • int resolution - Texture width resolution.

int getResolution ( ) const#

Returns the texture width resolution.

void setFlags ( int flags ) #

Sets texture flags.

Arguments

  • int flags - Texture flags.

int getFlags ( ) const#

Returns texture flags.

void * addChangedCallback ( Unigine::CallbackBase * func ) #

Adds a callback function to be called on changing the curve texture. The signature of the changed callback function must be as follows:
Source code (C++)
void changed_callback_function_name();

You can set a callback function as follows:

Source code (C++)
addChangedCallback(MakeCallback(changed_callback_function_name));

Arguments

  • Unigine::CallbackBase * func - Callback pointer.

Return value

ID of the last added changed callback, if the callback was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary.

bool removeChangedCallback ( void * id ) #

Removes the specified callback from the list of changed callbacks.

Arguments

  • void * id - Changed callback ID obtained when adding it.

Return value

True if the changed callback with the given ID was removed successfully; otherwise false.

void clearChangedCallbacks ( ) #

Clears all added changed callbacks.
Last update: 2020-10-10
Build: ()