This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
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
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Unigine::ObjectMeshClutter Class

Header: #include <UnigineObjects.h>
Inherits from: Object

MeshClutter is used to scatter identical meshes (with the same material applied to their surfaces), as well as randomly scale and orient them. Scattered meshes are baked into one object, which allows for less cluttered spatial tree, reduces the number of texture fetches and speeds up rendering.

Meshes are rendered within a specified distance from the camera. Further than this distance, nodes fade out and then disappear completely.

You can use a mask to cut out clutter objects in the areas of intersection with other objects and decals (e.g. to remove vegetation under houses or from the surface of roads projected using decals).

Important Notes#

The number of clutter elements in each cell is determined by the clutter Size along X and Y axes, as well as by Density and Step values. Relationship between these values in internal calculations may result in an invisible clutter (generated with empty cells), when the calculated density for cells becomes lower than 1 (each cell will have "less than 1 element" - meaning no clutter elements at all). Please take it into account when setting these values.

Number of clutter cells is calculated using the following formulas:

Source code (C++)
num_cells_x = max(Math::ftoi(Math::ceil(clutter_size_x / step)), 1);
num_cells_y = max(Math::ftoi(Math::ceil(clutter_size_y / step)), 1);

The size of each cell along X and Y axes is calculated as follows:

Source code (C++)
cell_size_x = clutter_size_x / Math::itof(num_cells_x);
cell_size_y = clutter_size_y / Math::itof(num_cells_y);

And the resulting cell density:

Source code (C++)
cell_density = cell_size_x * cell_size_y * density;

Example:

The default Step and Density values for the clutter are equal to 1.0f. Setting clutter size along any of the axes to a non-integer value with a non-zero fractional part (e.g., 200.1) automatically increases the number of cells along the corresponding axis by 1 (e.g. 201 instead of 200). This results in a cell size < 1, which makes cell density drop below 1.

ObjectMeshClutter Class

Members


static ObjectMeshClutterPtr create ( const char * path ) #

ObjectMeshClutter constructor. Creates a clutter using the path to the base mesh provided.

Arguments

  • const char * path - Path to the base mesh file.

static ObjectMeshClutterPtr create ( ) #

Default ObjectMeshClutter constructor. Creates an empty clutter.

void setAngle ( float angle ) #

Sets the angle cosine that defines the slope steepness appropriate for positioning meshes.

Arguments

  • float angle - Slope angle cosine. The provided value will be clipped in range [0;1].

float getAngle ( ) const#

Returns the current angle cosine that defines the slope steepness appropriate for positioning meshes.

Return value

Slope angle cosine.

void setCollision ( bool collision ) #

Sets a value indicating if collisions with the object should be taken into account.
Notice
If the collision parameter is set to 0, the new geometry will never be generated by collision detection request.

Arguments

  • bool collision - true to take collisions into account and make the object important for physics; false to allow collisions only with already generated geometry.

bool getCollision ( ) const#

Returns a value indicating if collisions with the object should be taken into account.
Notice
If the return value is false the new geometry will never be generated by collision detection request.

Return value

1 if collisions are taken into account; 0 if collisions are allowed only with already generated geometry.

void setDensity ( float density ) #

Sets the density factor that defines the number of meshes per square unit.
Notice
The number of clutter elements in each cell is determined by the clutter Size along X and Y axes, as well as by Density and Step values. Relationship between these values in internal calculations may result in an invisible clutter. When setting these values, please consider this information.

Arguments

  • float density - Density factor. If a negative value is provided, 0 will be used instead.

float getDensity ( ) const#

Returns the current density factor that defines the number of meshes per square unit.

Return value

Density factor.

void setFadeDistance ( float distance ) #

Sets the distance up to which meshes scattered by the mesh clutter will be fading out (that is, fewer meshes will be rendered instead of all). The distance is measured starting from the visible distance.
Notice
In order for a fade distance to be applied, visibility distance should not be infinite.

Arguments

  • float distance - Distance of fading for meshes in units. If a negative value is provided, 0 will be used instead.

float getFadeDistance ( ) const#

Returns the current distance up to which meshes scattered by the mesh clutter are fading out (that is, fewer meshes will be rendered instead of all). The distance is measured starting from the visible distance.
Notice
In order for a fade distance to be applied, visibility distance should not be infinite.

Return value

Distance of nodes fading in units.

void setIntersection ( bool intersection ) #

Sets a value indicating whether meshes should be scattered upon the ground (along its relief): either the terrain or a mesh set as a parent node.

Arguments

  • bool intersection - Positive number to enable intersection; 0 to disable.

bool getIntersection ( ) const#

Returns a value indicating whether meshes are scattered upon the ground (along its relief): either the terrain or a mesh set as a parent node.

Return value

1 if intersection is enabled; otherwise, 0.

void setMaskFlipX ( int value ) #

Flip the mask by X axis.

Arguments

  • int value - Positive value to flip the mask; otherwise, 0.

int getMaskFlipX ( ) const#

Returns a flag indicating if a mask is flipped by X axis.

Return value

Positive value if the mask is flipped; otherwise, 0.

void setMaskFlipY ( int value ) #

Flip the mask by Y axis.

Arguments

  • int value - Positive value to flip the mask; otherwise, 0.

int getMaskFlipY ( ) const#

Returns a flag indicating if a mask is flipped by Y axis.

Return value

Positive value if the mask is flipped; otherwise, 0.

int setMaskImage ( const Ptr<Image> & image, bool invalidate = 1 ) #

Sets an image (in R8 format) as a mask, that defines placement of meshes.

Arguments

  • const Ptr<Image> & image - Image smart pointer.
  • bool invalidate - Invalidate flag. Set true to invalidate all mesh clutter cells; otherwise, set false. All invalidated cells will be regenerated.

Return value

1 if the mask image is successfully set; otherwise, 0.

int getMaskImage ( const Ptr<Image> & image ) const#

Writes the image that is currently used as a mask for placement of meshes to the given buffer.

Arguments

  • const Ptr<Image> & image - Image smart pointer.

Return value

1 if the mask image is successfully written into the buffer; otherwise, 0.

void setMaskImageName ( const char * image_name, bool invalidate = 1 ) #

Sets the path to a mask image (in R8 format) that defines the placement of meshes.

Arguments

  • const char * image_name - Path to the mask image.
  • bool invalidate - Invalidate flag. Set true to invalidate all mesh clutter cells; otherwise, set false. All invalidated cells will be regenerated.

void setMaskImageName ( const char * name ) #

Sets the path to a mask image (in R8 format) that defines the placement of meshes.

Arguments

  • const char * name - Path to the mask image (in R8 format).

const char * getMaskImageName ( ) const#

Returns the path to a mask image (in R8 format) that defines the placement of meshes.

Return value

Path to the mask image.

void setMaskInverse ( int inverse ) #

Specifies if clutter meshes should be rendered inside or outside the mask mesh contour.

Arguments

  • int inverse - 0 to render clutter meshes inside the mask mesh contour; 1 to render them outside.

int getMaskInverse ( ) const#

Returns a flag indicating if clutter meshes are rendered inside or outside the mask mesh contour.

Return value

0 if clutter meshes are rendered inside the mask mesh contour; 1 if outside.

void setMaskMaxValue ( int value ) #

Sets the maximum value of the mask application range.

Arguments

  • int value - Maximum mask value, [0;255].

int getMaskMaxValue ( ) const#

Returns the maximum value of the mask application range.

Return value

Maximum mask value.

int setMaskMesh ( const Ptr<Mesh> & mesh, bool invalidate = 1 ) #

Sets a mesh to be used as a mask on-the-fly. Limitations:
  • Before the method is called, another mesh must be set via setMaskMeshName() first.
  • If the world is reloaded, the mesh set via setMaskMeshName() will be loaded.
  • If the memory limit is exceeded, the new mesh might be replaced with the mesh set via setMaskMeshName().

Arguments

  • const Ptr<Mesh> & mesh - Pointer to the mesh.
  • bool invalidate - Invalidate flag. Set true to invalidate all mesh clutter cells; otherwise, set false. All invalidated cells will be regenerated.

Return value

1 if the mesh is set successfully; otherwise - 0.

int getMaskMesh ( const Ptr<Mesh> & mesh ) const#

Copies the current mask mesh (if it exists) to the specified target mesh.

Arguments

  • const Ptr<Mesh> & mesh - Pointer to the mesh to copy the current mask mesh to.

Return value

1 if mesh mask exists; otherwise - 0.

void setMaskMeshName ( const char * mesh_name, bool invalidate = 1 ) #

Sets a mesh to be used as a mask for the mesh clutter. This mesh should be plane.

Arguments

  • const char * mesh_name - Path to the *.mesh file.
  • bool invalidate - Invalidate flag. Set true to invalidate all mesh clutter cells; otherwise, set false. All invalidated cells will be regenerated.

void setMaskMeshName ( const char * name ) #

Sets a mesh to be used as a mask for the mesh clutter. This mesh should be plane.

Arguments

  • const char * name - Path to the *.mesh file.

void createClutterTransforms ( ) #

Creates transformations for all clutter meshes.

const char * getMaskMeshName ( ) const#

Returns the name (path) of the current mesh used as a mask for the mesh clutter. This mesh should be plane.

Return value

Path to the *.mesh file.

void setMaskMinValue ( int value ) #

Sets the minimum value of the mask application range.

Arguments

  • int value - Minimum mask value, [0;255].

int getMaskMinValue ( ) const#

Returns the minimum value of the mask application range.

Return value

Minimum mask value.

void setTerrainMask ( int mask ) #

Sets a new Landscape Terrain mask to be used to define placement of meshes.

Arguments

  • int mask - Index of Landscape Terrain mask to be used to define placement of meshes, in the [0; 19] range.

int getTerrainMask ( ) const#

Returns the index of the Landscape Terrain mask currently used to define placement of meshes.

Return value

Index of the Landscape Terrain mask currently used to define placement of meshes, in the [0; 19] range.

void setMaxScale ( float mean, float spread ) #

Sets the scale for meshes in the areas with high density (according to the mask). With the minimum scale it is possible to automatically render, for example, big trees in the center of the forest. A spread value allows you to control the range of scales relative to the mean value.

Arguments

  • float mean - Scale mean value.
  • float spread - Maximum spread value to randomly upscale or downscale objects.

float getMaxScaleMean ( ) const#

Returns the scale mean value for meshes in the areas with high density (according to the mask).

Return value

Scale mean value.

float getMaxScaleSpread ( ) const#

Returns the scale spread value that controls the range of mesh scales in the areas with high density (according to the mask).

Return value

Scale spread value.

void setMeshesRotation ( const Math::vec3 & mean, const Math::vec3 & spread ) #

Sets the parameters of pseudo-random rotation of meshes along X, Y and Z axes.

Arguments

  • const Math::vec3 & mean - Mean values of meshes rotation angles, in degrees.
  • const Math::vec3 & spread - Maximum spread values of meshes rotation angles, in degrees.

Math::vec3 getMeshesRotationMean ( ) const#

Returns the vector of mean values of meshes rotation along X, Y and Z axes.

Return value

Mean values of meshes rotation angles, in degrees.

Math::vec3 getMeshesRotationSpread ( ) const#

Returns the vector of spread values of meshes rotation along X, Y and Z axes.

Return value

Maximum spread values of meshes rotation angles, in degrees.

void setMeshPath ( const char * path ) #

Sets a path to the mesh scattered by the mesh clutter. Does not update mesh immediately using the new path. If the mesh is in the procedural mode, it will be reset.

Arguments

  • const char * path - New path to the source .mesh-file to be set.

const char * getMeshPath ( ) const#

Returns the path to the source .mesh-file of the base mesh scattered by mesh clutter.

Return value

Path to the source .mesh-file.

void setMinScale ( float mean, float spread ) #

Sets the scale for meshes in the areas with low density (according to the mask). With the minimum scale it is possible to automatically render, for example, small trees at the forest border. A spread value allows you to control the range of scales relative to the mean value.

Arguments

  • float mean - Scale mean value.
  • float spread - Maximum spread value to randomly upscale or downscale objects.

float getMinScaleMean ( ) const#

Returns the scale mean value for meshes in the areas with low density (according to the mask).

Return value

Scale mean value.

float getMinScaleSpread ( ) const#

Returns the scale spread value that controls the range of mesh scales in the areas with low density (according to the mask).

Return value

Scale spread value.

void setOffset ( float mean, float spread ) #

Sets the vertical offset that determines the placement of meshes above or below the surface.

Arguments

  • float mean - Mean value of the offset in units.
  • float spread - Spread value of the offset in units.

float getOffsetMean ( ) const#

Returns the current mean value of the vertical offset that determines the placement of meshes above or below the surface.

Return value

Mean value of the offset in units.

float getOffsetSpread ( ) const#

Returns the current spread value of the vertical offset that determines the placement of meshes above or below the surface.

Return value

Spread value of the offset in units.

void setOrientation ( bool orientation ) #

Sets a value indicating whether meshes should be oriented along the normals of the ground (either the terrain or a mesh set as a parent node).

Arguments

  • bool orientation - Positive number to enable orientation; 0 to disable.

bool getOrientation ( ) const#

Returns a value indicating whether meshes are oriented along the normals of the ground (either the terrain or a mesh set as a parent node).

Return value

1 if orientation is enabled; otherwise, 0.

void setSeed ( int seed ) #

Sets the seed for pseudo-random positioning of meshes.

Arguments

  • int seed - Number used to initialize a pseudo-random sequence. If a negative value is provided, 0 will be used instead.

int getSeed ( ) const#

Returns the seed used for pseudo-random positioning of meshes.

Return value

Number used to initialize a pseudo-random sequence.

void setSizeX ( float sizex ) #

Sets the width of the mesh clutter along the X-coordinate.
Notice
The number of clutter elements in each cell is determined by the clutter Size along X and Y axes, as well as by Density and Step values. Relationship between these values in internal calculations may result in an invisible clutter. When setting these values, please consider this information.

Arguments

  • float sizex - X-coordinate width in units. If a negative value is provided, 0 will be used instead.

float getSizeX ( ) const#

Returns the current width of the mesh clutter along the X-coordinate.

Return value

X-coordinate width in units.

void setSizeY ( float sizey ) #

Sets the length of the mesh clutter along the Y-coordinate.
Notice
The number of clutter elements in each cell is determined by the clutter Size along X and Y axes, as well as by Density and Step values. Relationship between these values in internal calculations may result in an invisible clutter. When setting these values, please consider this information.

Arguments

  • float sizey - Y-coordinate length in units. If a negative value is provided, 0 will be used instead.

float getSizeY ( ) const#

Returns the current length of the mesh clutter along the Y-coordinate.

Return value

Y-coordinate length in units.

int getSpawnCount ( ) const#

Returns the number of cells to be generated.

Return value

Number of cells to be generated if the scene generation is not completed; otherwise, 0.

void setStep ( float step ) #

Sets the step for cells used to render mesh clutter.
Notice
The number of clutter elements in each cell is determined by the clutter Size along X and Y axes, as well as by Density and Step values. Relationship between these values in internal calculations may result in an invisible clutter. When setting these values, please consider this information.

Arguments

  • float step - Step for clutter cells in units.

float getStep ( ) const#

Returns the step for cells used to render meshes scattered by the mesh clutter.

Return value

Step for clutter cells in units.

void setThreshold ( float threshold ) #

Sets the density threshold (for a mask) starting from which meshes are rendered if placed dense enough.

Arguments

  • float threshold - Density threshold. The provided value will be clipped in range [0;1].

float getThreshold ( ) const#

Returns the current density threshold (for a mask) starting from which meshes are rendered if placed dense enough.

Return value

Density threshold.

void setVisibleDistance ( float distance ) #

Sets the distance up to which meshes scattered by the mesh clutter will be rendered.

Arguments

  • float distance - Distance of visibility for meshes in units. If a negative value is provided, 0 will be used instead.

float getVisibleDistance ( ) const#

Returns the current distance up to which meshes scattered by the mesh clutter are rendered.

Return value

Distance of visibility for meshes in units.

void applyMeshProcedural ( const Ptr<Mesh> & mesh ) #

Sets the specified mesh as the base mesh for the object. The object must be in the procedural mesh mode.
Source code (C++)
ObjectMeshClutterPtr my_mesh_clutter;
// ...

// switch the object to procedural mesh mode
my_mesh_clutter->setMeshProceduralMode(true);

// update the source mesh of the "my_mesh_clutter" object via the source_mesh instance
my_mesh_clutter->applyMeshProcedural(source_mesh);

Arguments

  • const Ptr<Mesh> & mesh - Mesh to be applied.

void invalidate ( ) #

Invalidates all mesh clutter cells. All invalidated cells will be regenerated.

void invalidate ( const Math::WorldBoundBox & bounds ) #

Invalidates all mesh clutter cells within the area specified by the given bounding box. All invalidated cells will be regenerated.

Arguments

  • const Math::WorldBoundBox & bounds - Bounding box, defining the area, where mesh clutter cells will be regenerated.

static int type ( ) #

Returns the node type.

Return value

Node type identifier.

void clearClutterExcludes ( ) #

Restores all cells removed by the calls to the setClutterExclude() method. Restored cells will be regenerated.

void setClutterExclude ( const Math::WorldBoundBox & bounds, int exclude ) #

Removes all cells within the area specified by the given bounding box. Generation of these cells will be skipped. This method can be used to replace some parts of the clutter with modified meshes (e.g., broken trees within the area around the shell crater in the forest).

Arguments

  • const Math::WorldBoundBox & bounds - Bounding box, defining the area, where mesh clutter cells will not be generated.
  • int exclude - Exclude flag. Set 1 to remove all mesh clutter cells within the area; otherwise, set 0 to restore the removed ones. Restored cells will be regenerated.

bool getClutterTransforms ( const Math::WorldBoundBox & bounds, Vector< Math::mat4> & transforms, bool precise = 1, bool force = 1 ) const#

Collects transformations for all clutter meshes in the generated cells within the area specified by the given bounding box and puts them to the specified buffer.
Notice
Generation of clutter cells is performed in separate threads. Some of the cells may have their lifetime expired. Therefore, the content of certain cells might be unavailable at the moment, such cells are considered as not generated.

Arguments

  • const Math::WorldBoundBox & bounds - Bounding box, defining the area, for which the transformations of clutter meshes are to be collected.
  • Vector< Math::mat4> & transforms - Buffer to store transformations of clutter meshes.
  • bool precise - Precision flag:
    • 1 - transformations will be collected for clutter meshes within the specified bounding box
    • 0 - transformations will be collected for clutter meshes within the cells intersected by the specified bounding box
  • bool force - Force flag.
    • 1 - regenerate all cells within the area, that were not generated, before collecting transformations for the meshes inside them.
    • 0 - transformations will be collected only for the meshes inside the clutter cells, that were generated.

Return value

1, if there are transformations of clutter meshes; or 0, if there are no transformations of clutter meshes found.

bool getClutterTransforms ( Vector< Math::mat4> & transforms ) const#

Collects transformations for all clutter meshes within the generated cells and puts them to the specified buffer.
Notice
Generation of clutter cells is performed in separate threads. Some of the cells may have their lifetime expired. Therefore, the content of certain cells might be unavailable at the moment, such cells are considered as not generated.

Arguments

  • Vector< Math::mat4> & transforms - Buffer to store transformations of clutter meshes.

Return value

1, if there are transformations of clutter meshes; or 0, if there are no transformations of clutter meshes found.

bool getClutterWorldTransforms ( const Math::WorldBoundBox & bounds, Vector< Math::Mat4> & transforms, bool precise = 1, bool force = 1 ) const#

Collects transformations (in world coordinates) for all clutter meshes in the generated cells within the area specified by the given bounding box and puts them to the specified buffer.
Notice
Generation of clutter cells is performed in separate threads. Some of the cells may have their lifetime expired. Therefore, the content of certain cells might be unavailable at the moment, such cells are considered as not generated.

Arguments

  • const Math::WorldBoundBox & bounds - Bounding box, defining the area, for which the transformations of clutter meshes are to be collected.
  • Vector< Math::Mat4> & transforms - Buffer to store transformations of clutter meshes, in world coordinates.
  • bool precise - Precision flag:
    • 1 - transformations will be collected for clutter meshes within the specified bounding box
    • 0 - transformations will be collected for clutter meshes within the cells intersected by the specified bounding box
  • bool force - Force flag.
    • 1 - regenerate all cells within the area, that were not generated, before collecting transformations for the meshes inside them.
    • 0 - transformations will be collected only for the meshes inside the clutter cells, that were generated.

Return value

1, if there are transformations of clutter meshes; or 0, if there are no transformations of clutter meshes found.

bool getClutterWorldTransforms ( Vector< Math::Mat4> & transforms ) const#

Collects transformations (in world coordinates) for all clutter meshes within the generated cells and puts them to the specified buffer.
Notice
Generation of clutter cells is performed in separate threads. Some of the cells may have their lifetime expired. Therefore, the content of certain cells might be unavailable at the moment, such cells are considered as not generated.

Arguments

  • Vector< Math::Mat4> & transforms - Buffer to store transformations of clutter meshes, in world coordinates.

Return value

1, if there are transformations of clutter meshes; or 0, if there are no transformations of clutter meshes found.

int getClutterLocalTransforms ( const Math::BoundBox & bounds, Vector< Math::mat4> & transforms, int precise = 1, int force = 1 ) const#

Collects transformations (in local coordinates) for all clutter meshes within the generated cells and puts them to the specified buffer.
Notice
Generation of clutter cells is performed in separate threads. Some of the cells may have their lifetime expired. Therefore, the content of certain cells might be unavailable at the moment, such cells are considered as not generated.

Arguments

  • const Math::BoundBox & bounds - Bounding box, defining the area, for which the transformations of clutter meshes are to be collected.
  • Vector< Math::mat4> & transforms - Buffer to store transformations of clutter meshes, in local coordinates.
  • int precise - Precision flag:
    • 1 - transformations will be collected for clutter meshes within the specified bounding box
    • 0 - transformations will be collected for clutter meshes within the cells intersected by the specified bounding box
  • int force - Force flag.
    • 1 - regenerate all cells within the area, that were not generated, before collecting transformations for the meshes inside them.
    • 0 - transformations will be collected only for the meshes inside the clutter cells, that were generated.

Return value

1, if there are transformations of clutter meshes; or 0, if there are no transformations of clutter meshes found.

void setCutoutIntersectionMask ( int mask ) #

Sets a new cutout intersection mask. This mask allows you to cut out clutter objects in the areas of intersection with other objects and decals (e.g. can be used to remove vegetation under houses or from the surface of roads projected using decals). Clutter objects will be cut out by objects and decals that have their intersection mask matching this one (one bit at least).
Notice
To set intersection masks the following methods can be used:

Arguments

  • int mask - Integer, each bit of which is a mask.

int getCutoutIntersectionMask ( ) const#

Returns the current cutout intersection mask. This mask allows you to cut out clutter objects in the areas of intersection with other objects and decals (e.g. can be used to remove vegetation under houses or from the surface of roads projected using decals). Clutter objects will be cut out by objects and decals that have their intersection mask matching this one (one bit at least).
Notice
To set intersection masks the following methods can be used:

Return value

Integer, each bit of which is a mask.

void setCutoutInverse ( int inverse ) #

Sets a value indicating whether the clutter objects should be rendered inside or outside the areas determined by the cutout intersection mask.

Arguments

  • int inverse - 0 to render clutter objects outside the areas determined by the cutout intersection mask; 1 to render the clutter objects inside these areas.

int getCutoutInverse ( ) const#

Returns a value indicating if the clutter objects is rendered inside or outside the areas determined by the cutout intersection mask.

Return value

0 if clutter objects are rendered outside the areas determined by the cutout intersection mask; 1 if inside.

Ptr<MeshStatic> getMeshInfo ( ) #

Returns the base mesh that stores data on mesh bounds, surfaces, their number, names, and bounds, but doesn't contain any geometry.
Notice
It's highly recommended NOT to edit the returned mesh.

Return value

A base static mesh used for the object.

Ptr<MeshStatic> getMeshForce ( ) #

Returns the base mesh used for the object. The returned static mesh won't be loaded to VRAM.
Notice
It's highly recommended NOT to edit the returned mesh.

Return value

A base static mesh used for the object.

Ptr<MeshStatic> getMeshAsync ( ) #

Returns the base mesh used for the object asynchronously. This function can be called if the mesh hasn't been loaded yet.
Notice
It's highly recommended NOT to edit the returned mesh.

Return value

A base static mesh used for the object.

Ptr<MeshStatic> getMeshForceVRAM ( ) #

Returns the base mesh used for the object and loads it to video memory (VRAM). At that, the static mesh will also be loaded to memory (RAM).
Notice
Loading to VRAM must be performed in the main thread only.

Return value

A base static mesh used for the object.

Ptr<MeshStatic> getMeshAsyncVRAM ( ) #

Returns the base mesh used for the object asynchronously and loads it to video memory (VRAM). At that, the static mesh will also be loaded to memory (RAM).
Notice
Loading to VRAM must be performed in the main thread only.

Return value

A base static mesh used for the object.

bool loadAsyncVRAM ( ) #

Asynchronously loads the mesh to video memory (VRAM) if the async streaming mode for meshes is enabled. Otherwise, the forced loading is performed. This method is recommended for implementing your own prefetch system (i.e. asynchronous pre-loading of meshes to video memory before they are used).
Notice
Loading to VRAM must be performed in the main thread only.

Return value

true if the mesh is loaded successfully, otherwise false. If the mesh is already loaded to VRAM, true will be returned.

bool loadAsyncRAM ( ) #

Asynchronously loads the mesh to memory (RAM) if the async streaming mode for meshes is enabled. Otherwise, the forced loading is performed. This method is recommended for implementing your own prefetch system (i.e. asynchronous pre-loading of meshes to memory before they are used).

Return value

true if the mesh is loaded successfully, otherwise false. If the mesh is already loaded to RAM, true will be returned.

bool loadForceVRAM ( ) #

Performs force-loading of the mesh to video memory (VRAM) immediately.
Notice
Loading to VRAM must be performed in the main thread only.

Return value

true if the mesh is loaded successfully, otherwise false. If the mesh is already loaded to VRAM, true will be returned.

bool loadForceRAM ( ) #

Performs force-loading of the mesh to memory (RAM) immediately.

Return value

true if the mesh is loaded successfully, otherwise false. If the mesh is already loaded to RAM, true will be returned.

bool asyncCalculateNodes ( int surface ) #

Asynchronously calculates the mesh surface internal spatial tree used for quick calculation of collisions and intersections. This method is recommended for implementing your own prefetch system (i.e. asynchronous pre-loading of meshes to memory before they are used).

Arguments

  • int surface - Mesh surface number.

Return value

true if the internal tree is calculated successfully; otherwise, false.

bool asyncCalculateEdges ( int surface ) #

Asynchronously calculates the edges of the mesh surface geometry. This method is recommended for implementing your own prefetch system (i.e. asynchronous pre-loading of meshes to memory before they are used).

Arguments

  • int surface - Mesh surface number.

Return value

true if the edges are calculated successfully; otherwise, false.

void setMeshProceduralMode ( bool meshproceduralmode ) #

Sets a value indicating if the base mesh used for the object is procedural. A procedural mesh is a mesh created via code, such meshes have a specific streaming mode - they are always kept in memory after creation and never unloaded until the object is destroyed via code or the mesh returns to its normal mode (streaming from a source file). Changing of the base static mesh is possible only if it is in the procedural mode.

Arguments

  • bool meshproceduralmode - true to switch the base mesh used for the object to procedural mode; otherwise, false - normal mode (the base mesh is streamed from a source file).

bool isMeshProceduralMode ( ) const#

Returns a value indicating if the base mesh used for the object is procedural. A procedural mesh is a mesh created via code, such meshes have a specific streaming mode - they are always kept in memory after creation and never unloaded until the object is destroyed via code or the mesh returns to its normal mode (streaming from a source file). Changing of the base static mesh is possible only if it is in the procedural mode.

Return value

true if the base mesh used for the object is procedural; otherwise, false - normal mode (the base mesh is streamed from a source file).

bool isMeshNull ( ) const#

Returns a value indicating if the base mesh used for the object is null (does not exist, unassigned, not loaded, etc.).

Return value

true if the base mesh used for the object is null; otherwise, false.

bool isMeshLoadedRAM ( ) const#

Returns a value indicating if the base mesh used for the object is loaded to memory (RAM).

Return value

true if the base mesh used for the object is loaded to RAM; otherwise, false.

bool isMeshLoadedVRAM ( ) const#

Returns a value indicating if the base mesh used for the object is loaded to video memory (VRAM).

Return value

true if the base mesh used for the object is loaded to VRAM; otherwise, false.

void setMeshStreamingModeRAM ( Object::STREAMING_OBJECT_MESH meshstreamingmoderam ) #

Sets the streaming mode for loading the mesh to memory (RAM).

Arguments

Object::STREAMING_OBJECT_MESH getMeshStreamingModeRAM ( ) const#

Returns the current streaming mode for loading the mesh to memory (RAM).

Return value

Mesh streaming mode.

void setMeshStreamingModeVRAM ( Object::STREAMING_OBJECT_MESH meshstreamingmodevram ) #

Sets the streaming mode for loading the mesh to video memory (VRAM).

Arguments

Object::STREAMING_OBJECT_MESH getMeshStreamingModeVRAM ( ) const#

Returns the current streaming mode for loading the mesh to video memory (VRAM).

Return value

Mesh streaming mode.
Last update: 2023-06-23
Build: ()