This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
基础
专业(SIM)
UnigineEditor
界面概述
资源工作流程
Version Control
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
统一的Unigine着色器语言 UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
材质和着色器
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
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
创建内容
内容优化
材质
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

Unigine::Plugins::SpiderVision::WarpGridData Class

Header: #include <plugins/Unigine/SpiderVision/UnigineSpiderVision.h>

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

枚举

VIEWPORT_FLIP_TYPE#

Name描述
VIEWPORT_FLIP_TYPE_NONE = 0The canvas mask is not flipped.
VIEWPORT_FLIP_TYPE_VERTICAL = 1The canvas mask is flipped vertically.
VIEWPORT_FLIP_TYPE_HORIZONTAL = 2The canvas mask is flipped horizontally.
VIEWPORT_FLIP_TYPE_BOTH = 3The canvas mask is flipped both vertically and horizontally.

WARP_HANDLE_ROLE#

Name描述
WARP_HANDLE_ROLE_LEFT = 0Left-side control handle of the warping control point on the grid.
WARP_HANDLE_ROLE_RIGHT = 1Right-side control handle of the warping control point on the grid.
WARP_HANDLE_ROLE_UP = 2Top-side control handle of the warping control point on the grid.
WARP_HANDLE_ROLE_DOWN = 3Bottom-side control handle of the warping control point on the grid.
WARP_HANDLE_ROLE_NUM = 4Total number of control handles of the warping control point.

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, const Math::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.
  • const Math::vec2 & point - Screen-space coordinates of the point.

void setPoint ( int index, const Math::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.
  • const Math::vec2 & point - Screen-space coordinates of the point.

Math::vec2 getPoint ( int x, int y ) const#

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.

Math::vec2 getPoint ( int index ) const#

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, WarpGridData::WARP_HANDLE_ROLE type, const Math::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.
  • WarpGridData::WARP_HANDLE_ROLE type - Type of control handle of the warping control point.
  • const Math::vec2 & point - Screen-space coordinates of the point.

void setPointHandle ( int index, WarpGridData::WARP_HANDLE_ROLE type, const Math::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.
  • WarpGridData::WARP_HANDLE_ROLE type - Type of control handle of the warping control point.
  • const Math::vec2 & point - Screen-space coordinates of the point.

Math::vec2 getPointHandle ( int x, int y, WarpGridData::WARP_HANDLE_ROLE type ) const#

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.
  • WarpGridData::WARP_HANDLE_ROLE type - Type of control handle of the warping control point.

Return value

Screen-space coordinates of the point.

Math::vec2 getPointHandle ( int index, WarpGridData::WARP_HANDLE_ROLE type ) const#

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.
  • WarpGridData::WARP_HANDLE_ROLE type - Type of control handle of the warping control point.

Return value

Screen-space coordinates of the point.

void setPointHandleSmoothType ( int x, int y, ViewportData::POINT_SMOOTH_TYPE 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.
  • ViewportData::POINT_SMOOTH_TYPE smooth_type - The type of line curving for the handle point.

void setPointHandleSmoothType ( int index, ViewportData::POINT_SMOOTH_TYPE 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.
  • ViewportData::POINT_SMOOTH_TYPE smooth_type - The type of line curving for the handle point.

ViewportData::POINT_SMOOTH_TYPE getPointHandleSmoothType ( int x, int y ) const#

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.

ViewportData::POINT_SMOOTH_TYPE getPointHandleSmoothType ( int index ) const#

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 ( const Ptr<Xml> & xml ) #

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

Arguments

  • const Ptr<Xml> & xml - Xml class instance into which the data will be saved.

bool restoreXml ( const Ptr<Xml> & xml ) #

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

Arguments

  • const Ptr<Xml> & xml - Xml class instance the data from which is to be loaded.

Return value

true if the data has been loaded successfully, otherwise false.

void save ( const Ptr<Stream> & stream ) #

Saves the warp grid data to the specified stream.

Arguments

  • const Ptr<Stream> & stream - Stream to which the data is to be written.

void restore ( const Ptr<Stream> & stream ) #

Loads the warp grid data from the specified stream.

Arguments

  • const Ptr<Stream> & stream - Stream the data from which is to be loaded.
Last update: 2024-08-16
Build: ()