Editor API
UnigineEditor public API
|
This class is used to manage viewport windows in the Editor. More...
Inherits APIInterface.
Public Member Functions | |
void | show () |
Shows the viewport window. More... | |
void | hide () |
Hides the viewport window. More... | |
const char * | getName () const |
Returns the name of the viewport window. More... | |
void | setPlayer (const Unigine::Ptr< Unigine::Player > &player) |
Sets a new main player (camera) whose current view is to be rendered to the viewport window. More... | |
Unigine::Ptr< Unigine::Player > | getPlayer () const |
Returns a new main player (camera) whose current view is to be rendered to the viewport window. More... | |
Unigine::Ptr< Unigine::Viewport > | getViewport () const |
Returns the Engine Viewport instance for the viewport window. More... | |
Unigine::Ptr< Unigine::Gui > | getGui () const |
Returns the Gui instance for the viewport window. You can use it to add and manage your UI elements. More... | |
int | getMousePosX () const |
Returns the X coordinate of the mouse position relative to the viewport window. While the mouse cursor is within the window the coordinate is in the [0, getWidth() - 1] range, otherwise the value can be negative or greater than window width (depending on the mouse cursor position relative to the window). More... | |
int | getMousePosY () const |
Returns the Y coordinate of the mouse position relative to the viewport window. While the mouse cursor is within the window the coordinate is in the [0, getHeight() - 1] range, otherwise the value can be negative or greater than window height (depending on the mouse cursor position relative to the window). More... | |
Unigine::Math::ivec2 | getMousePos () const |
Returns the coordinates of the mouse position relative to the viewport window. Coordinates are returned as a two-component vector (X, Y). While the mouse cursor is within the window the coordinates are within the following ranges: X - [0, getWidth() - 1]; Y - [0, getHeight() - 1]. Otherwise the values can be negative or greater than window height and width (depending on the mouse cursor position relative to the window). More... | |
int | getWidth () const |
Returns the current width (in pixels) of the viewport window. More... | |
int | getHeight () const |
Returns the current height (in pixels) of the viewport window. More... | |
Unigine::Math::ivec2 | getSize () const |
Returns the current size of the viewport window. The value is returned as a two-component vector (Width, Height). More... | |
void | focusOnNode (const Unigine::Ptr< Unigine::Node > &node) |
Sets the camera focus for the viewport window on the specified node. More... | |
void | focusOnNodeList (const Unigine::Vector< Unigine::Ptr< Unigine::Node >> &nodes) |
Sets the camera focus for the viewport window on the specified nodes (the viewport will be adjusted to display all the specified nodes). More... | |
void | focusOnNodeBoundBased (const Unigine::Ptr< Unigine::Node > &node) |
Sets the current camera focus for the viewport window on the specified node based on its bounds (the viewport will be adjusted to display the specified node with its bounds). More... | |
void | focusOnNodeListBoundBased (const Unigine::Vector< Unigine::Ptr< Unigine::Node >> &nodes) |
Sets the current camera focus for the viewport window on the specified nodes based on their bounds (the viewport will be adjusted to display the specified nodes with their bounds). More... | |
void | focusOnSurface (const Unigine::Ptr< Unigine::Object > &object, int surface) |
Sets the camera focus for the viewport window on the specified surface of the specified object (the viewport will be adjusted to display the specified surface). More... | |
void | focusOnSurfaceList (const Unigine::Ptr< Unigine::Object > &object, const Unigine::Vector< int > &surfaces) |
Sets the camera focus for the viewport window on the specified surfaces of the specified object (the viewport will be adjusted to display all the specified surfaces). More... | |
void | focusOnCenter (const Unigine::Math::Vec3 ¢er, float radius) |
Sets the camera focus for the viewport window on an imaginary sphere with the specified center point and radius. More... | |
This class is used to manage viewport windows in the Editor.
void UnigineEditor::ViewportWindow::focusOnCenter | ( | const Unigine::Math::Vec3 & | center, |
float | radius | ||
) |
Sets the camera focus for the viewport window on an imaginary sphere with the specified center point and radius.
center | Coordinates of the center of an imaginary sphere to be focused on. |
radius | Radius of an imaginary sphere to be focused on. |
void UnigineEditor::ViewportWindow::focusOnNode | ( | const Unigine::Ptr< Unigine::Node > & | node | ) |
Sets the camera focus for the viewport window on the specified node.
node | Node to be focused on. |
void UnigineEditor::ViewportWindow::focusOnNodeBoundBased | ( | const Unigine::Ptr< Unigine::Node > & | node | ) |
Sets the current camera focus for the viewport window on the specified node based on its bounds (the viewport will be adjusted to display the specified node with its bounds).
node | Node to be focused on. |
void UnigineEditor::ViewportWindow::focusOnNodeList | ( | const Unigine::Vector< Unigine::Ptr< Unigine::Node >> & | nodes | ) |
Sets the camera focus for the viewport window on the specified nodes (the viewport will be adjusted to display all the specified nodes).
nodes | Vector containing nodes to be focused on. |
void UnigineEditor::ViewportWindow::focusOnNodeListBoundBased | ( | const Unigine::Vector< Unigine::Ptr< Unigine::Node >> & | nodes | ) |
Sets the current camera focus for the viewport window on the specified nodes based on their bounds (the viewport will be adjusted to display the specified nodes with their bounds).
nodes | List of nodes to be focused on. |
void UnigineEditor::ViewportWindow::focusOnSurface | ( | const Unigine::Ptr< Unigine::Object > & | object, |
int | surface | ||
) |
Sets the camera focus for the viewport window on the specified surface of the specified object (the viewport will be adjusted to display the specified surface).
object | Object to be focused on. |
surface | The number of the surface of the specified object to be focused on. |
void UnigineEditor::ViewportWindow::focusOnSurfaceList | ( | const Unigine::Ptr< Unigine::Object > & | object, |
const Unigine::Vector< int > & | surfaces | ||
) |
Sets the camera focus for the viewport window on the specified surfaces of the specified object (the viewport will be adjusted to display all the specified surfaces).
object | Object to be focused on. |
surfaces | Vector containing the numbers of surfaces of the specified object to be focused on. |
Unigine::Ptr<Unigine::Gui> UnigineEditor::ViewportWindow::getGui | ( | ) | const |
Returns the Gui instance for the viewport window. You can use it to add and manage your UI elements.
int UnigineEditor::ViewportWindow::getHeight | ( | ) | const |
Returns the current height (in pixels) of the viewport window.
Unigine::Math::ivec2 UnigineEditor::ViewportWindow::getMousePos | ( | ) | const |
Returns the coordinates of the mouse position relative to the viewport window. Coordinates are returned as a two-component vector (X, Y). While the mouse cursor is within the window the coordinates are within the following ranges: X - [0, getWidth() - 1]; Y - [0, getHeight() - 1]. Otherwise the values can be negative or greater than window height and width (depending on the mouse cursor position relative to the window).
int UnigineEditor::ViewportWindow::getMousePosX | ( | ) | const |
Returns the X coordinate of the mouse position relative to the viewport window. While the mouse cursor is within the window the coordinate is in the [0, getWidth() - 1] range, otherwise the value can be negative or greater than window width (depending on the mouse cursor position relative to the window).
int UnigineEditor::ViewportWindow::getMousePosY | ( | ) | const |
Returns the Y coordinate of the mouse position relative to the viewport window. While the mouse cursor is within the window the coordinate is in the [0, getHeight() - 1] range, otherwise the value can be negative or greater than window height (depending on the mouse cursor position relative to the window).
const char* UnigineEditor::ViewportWindow::getName | ( | ) | const |
Returns the name of the viewport window.
Unigine::Ptr<Unigine::Player> UnigineEditor::ViewportWindow::getPlayer | ( | ) | const |
Returns a new main player (camera) whose current view is to be rendered to the viewport window.
Unigine::Math::ivec2 UnigineEditor::ViewportWindow::getSize | ( | ) | const |
Returns the current size of the viewport window. The value is returned as a two-component vector (Width, Height).
Unigine::Ptr<Unigine::Viewport> UnigineEditor::ViewportWindow::getViewport | ( | ) | const |
Returns the Engine Viewport instance for the viewport window.
int UnigineEditor::ViewportWindow::getWidth | ( | ) | const |
Returns the current width (in pixels) of the viewport window.
void UnigineEditor::ViewportWindow::hide | ( | ) |
Hides the viewport window.
void UnigineEditor::ViewportWindow::setPlayer | ( | const Unigine::Ptr< Unigine::Player > & | player | ) |
Sets a new main player (camera) whose current view is to be rendered to the viewport window.
player | Player to be used as the main camera for the viewport window. |
void UnigineEditor::ViewportWindow::show | ( | ) |
Shows the viewport window.