Unigine::ObjectGuiMesh Class
Header: | #include <UnigineObjects.h> |
Inherits: | Object |
This class allows for rendering GUI onto an arbitrary mesh. Unlike ObjectGui, it can be used to create non-flat displays positioned in the world. If the mesh contains several surfaces, the same GUI will be rendered on each of them. Note that the GUI will be rendered according to the UV mapping of surfaces.
ObjectGuiMesh Class
Members
static ObjectGuiMeshPtr create(const Ptr<Mesh> & mesh, const char * name = 0)
ObjectGuiMesh constructor. Creates a new GUI mesh from a given file.Arguments
- const Ptr<Mesh> & mesh - A mesh smart pointer.
- const char * name - A name of a new GUI mesh.
static ObjectGuiMeshPtr create(const char * mesh_name, const char * name = 0, int unique = 0)
An ObjectGuiMesh constructor. The ObjectGuiMesh will be created on the basis of the specified mesh.Arguments
- const char * mesh_name - Path to the mesh file.
- const char * name - Name of the new GUI mesh.
- int unique - When you create several objects out of a single .mesh file, the instance of the mesh geometry is created. If you then change the source geometry, its instances will be changed as well. To avoid this, set the unique flag to 1, so a copy of the mesh geometry will be created and changes won't be applied.
This argument is available only if the first argument is string.
Ptr<ObjectGuiMesh> cast(const Ptr<Object> & base)
Casts an ObjectGuiMesh out of the Object instance.Arguments
- const Ptr<Object> & base - Pointer to Object.
Return value
Pointer to ObjectGuiMesh.Ptr<ObjectGuiMesh> cast(const Ptr<Node> & node)
Casts an ObjectGuiMesh out of the Node instance.Arguments
- const Ptr<Node> & node - Pointer to Node.
Return value
Pointer to ObjectGuiMesh.void setControlDistance(float distance)
Sets a distance at which the GUI becomes controllable.Arguments
- float distance - A new distance in units.
float getControlDistance()
Returns the distance at which the GUI becomes controllable.Return value
The distance in units.Ptr<Gui> getGui()
Returns a Gui instance associated with the object.Return value
Gui smart pointer.int setMesh(const Ptr<Mesh> & mesh)
Sets a mesh. The mesh passed as the argument will be copied to the current mesh.Arguments
- const Ptr<Mesh> & mesh - Pointer to the source mesh that must be copied.
Return value
1 if the mesh is copied successfully; otherwise, 0.int getMesh(const Ptr<Mesh> & mesh)
Returns a mesh. The current mesh will be copied to the source mesh passed as the argument.Arguments
- const Ptr<Mesh> & mesh - Pointer to the source mesh.
Return value
1 if the mesh is copied successfully; otherwise, 0.void setMeshName(const char * name)
Sets a new mesh name.Arguments
- const char * name - Name to be set for the mesh.
const char * getMeshName()
Returns the mesh name.Return value
Mesh name.void setMouseShow(int show)
Sets a value indicating if the mouse cursor should be rendered in the mesh GUI object.Arguments
- int show - 1 to render the mouse cursor; otherwise, 0.
int getMouseShow()
Returns a value indicating if the mouse cursor is rendered in the mesh GUI object.Return value
1 if the cursor is rendered; otherwise, 0.int getScreenHeight()
Returns the screen height of the mesh GUI object.Return value
The height in pixels.void setScreenSize(int width, int height)
Sets screen dimensions of the mesh GUI object.Arguments
- int width - A new width in pixels.
- int height - A new height in pixels.
int getScreenWidth()
Returns the screen width of the mesh GUI object.Return value
The width in pixels.int createMesh(const char * name, int unique = 0)
Creates a mesh.Arguments
- const char * name - Path to the mesh file.
- int unique - Dynamic flag:
- 0 - If the mesh vertices are changed in run-time, meshes loaded from the same file will be also changed.
- 1 - If the mesh vertices are changed in run-time, meshes loaded from the same file won't be changed.
Return value
1 if the mesh is created successfully; otherwise, 0.void flushMesh()
Flushes the mesh geometry into the video memory.int loadMesh(const char * name)
Loads a mesh file.Arguments
- const char * name - Mesh file name.
Return value
1 if the mesh is loaded successfully; otherwise, 0.int saveMesh(const char * name)
Saves the mesh into a file.Arguments
- const char * name - Mesh file name.
Return value
1 if the mesh is saved successfully; otherwise, 0.static int type()
Returns the type of ObjectMeshStatic.Return value
ObjectMeshStatic type identifier.Last update: 2017-07-03
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)