This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Basics
Rendering
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Version Control
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API Reference
Animations-Related Classes
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
Rendering-Related Classes
VR-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

WarpGridData Class

Warning
The scope of applications for UnigineScript is limited to implementing materials-related logic (material expressions, scriptable materials, brush materials). Do not use UnigineScript as a language for application logic, please consider C#/C++ instead, as these APIs are the preferred ones. Availability of new Engine features in UnigineScript (beyond its scope of applications) is not guaranteed, as the current level of support assumes only fixing critical issues.

The object of this class stores the information on the warp grid — a set of points and their handles that create a mesh based on which the displayed image is reshaped.

Warping of the image is required to render the projected image on a distorted surface in such a way that it would look undistorted.

This object is accessible via the corresponding method of the ViewportData class.

The mask data are stored in the configuration file.

WarpGridData Class

Members


void setGridSize ( int row, int column ) #

Sets the number of columns and rows on the warping grid.

Arguments

  • int row - Number of grid rows.
  • int column - Number of grid columns.

void setPoint ( int x, int y, vec2 point ) #

Sets the coordinates of the warping control point on the grid.

Arguments

  • int x - Position of the warping control point in the row, starting from 0 on the left.
  • int y - Position of the warping control point in the column, starting from 0 at the bottom.
  • vec2 point - Screen-space coordinates of the point.

void setPoint ( int index, vec2 point ) #

Sets the coordinates of the warping control point on the grid.

Arguments

  • int index - Warping control point index. The point with the 0 index is in the bottom left corner with the progression going upwards, and then to the next column bottom point.
  • vec2 point - Screen-space coordinates of the point.

vec2 getPoint ( int x, int y ) #

Returns the coordinates of the warping control point on the grid.

Arguments

  • int x - Position of the warping control point in the row, starting from 0 on the left.
  • int y - Position of the warping control point in the column, starting from 0 at the bottom.

Return value

Screen-space coordinates of the point.

vec2 getPoint ( int index ) #

Returns the coordinates of the warping control point on the grid.

Arguments

  • int index - Warping control point index. The point with the 0 index is in the bottom left corner with the progression going upwards, and then to the next column bottom point.

Return value

Screen-space coordinates of the point.

void setPointHandle ( int x, int y, int type, vec2 point ) #

Sets the type and position of the handle point for the specified warp grid point.

Arguments

  • int x - Position of the warping control point in the row, starting from 0 on the left.
  • int y - Position of the warping control point in the column, starting from 0 at the bottom.
  • int type - Type of control handle of the warping control point.
  • vec2 point - Screen-space coordinates of the point.

void setPointHandle ( int index, int type, vec2 point ) #

Sets the type and position of the handle point for the specified warp grid point.

Arguments

  • int index - Warping control point index. The point with the 0 index is in the bottom left corner with the progression going upwards, and then to the next column bottom point.
  • int type - Type of control handle of the warping control point.
  • vec2 point - Screen-space coordinates of the point.

vec2 getPointHandle ( int x, int y, int type ) #

Returns the type and position of the handle point for the specified warp grid point.

Arguments

  • int x - Position of the warping control point in the row, starting from 0 on the left.
  • int y - Position of the warping control point in the column, starting from 0 at the bottom.
  • int type - Type of control handle of the warping control point.

Return value

Screen-space coordinates of the point.

vec2 getPointHandle ( int index, int type ) #

Returns the type and position of the handle point for the specified warp grid point.

Arguments

  • int index - Warping control point index. The point with the 0 index is in the bottom left corner with the progression going upwards, and then to the next column bottom point.
  • int type - Type of control handle of the warping control point.

Return value

Screen-space coordinates of the point.

void setPointHandleSmoothType ( int x, int y, int smooth_type ) #

Sets the type of line curving for the handle point of the specified warp grid point.

Arguments

  • int x - Position of the warping control point in the row, starting from 0 on the left.
  • int y - Position of the warping control point in the column, starting from 0 at the bottom.
  • int smooth_type - The type of line curving for the handle point.

void setPointHandleSmoothType ( int index, int smooth_type ) #

Sets the type of line curving for the handle point of the specified warp grid point.

Arguments

  • int index - Warping control point index. The point with the 0 index is in the bottom left corner with the progression going upwards, and then to the next column bottom point.
  • int smooth_type - The type of line curving for the handle point.

int getPointHandleSmoothType ( int x, int y ) #

Returns the type of line curving for the handle point of the specified warp grid point.

Arguments

  • int x - Position of the warping control point in the row, starting from 0 on the left.
  • int y - Position of the warping control point in the column, starting from 0 at the bottom.

Return value

The type of line curving for the handle point.

int getPointHandleSmoothType ( int index ) #

Returns the type of line curving for the handle point of the specified warp grid point.

Arguments

  • int index - Warping control point index. The point with the 0 index is in the bottom left corner with the progression going upwards, and then to the next column bottom point.

Return value

The type of line curving for the handle point.

void saveXml ( Xml xml ) #

Saves the warp grid data to the given instance of the Xml class.

Arguments

  • Xml xml - Xml class instance into which the data will be saved.

int restoreXml ( Xml xml ) #

Loads the warp grid data from the specified instance of the Xml class.

Arguments

  • Xml xml - Xml class instance the data from which is to be loaded.

Return value

1 if the data has been loaded successfully, otherwise 0.

void save ( Stream stream ) #

Saves the warp grid data to the specified stream.

Arguments

  • Stream stream - Stream to which the data is to be written.

void restore ( Stream stream ) #

Loads the warp grid data from the specified stream.

Arguments

  • Stream stream - Stream the data from which is to be loaded.

The information on this page is valid for UNIGINE 2.20 SDK.

Last update: 2024-08-01
Build: ()