This page has been translated automatically.
Programming
Fundamentials
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Bounds-Related Classes
Containers
Controls-Related Classes
Core Library
Engine-Related Classes
GUI-Related Classes
Node-Related Classes
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
Rendering-Related Classes
Utility Classes
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.

Property Class

Interface for property manipulation.

To use this class, include the UnigineProperty.h file.

Property Class

Members


int getParameterIntMinValue (int num)

Returns the minimum allowed value of an integer parameter.

Arguments

  • int num - Number of the target parameter.

Return value

Minimum value.

int getParameterMask (int num)

Returns the current value of a given mask parameter.

Arguments

  • int num - Number of the target parameter in range from 0 to the total number of parameters.

Return value

Parameter value.

Math::vec4 getParameterVec4 (int num)

Gets a value of the given vec4 parameter.

Arguments

  • int num - Parameter number.

Return value

Parameter value.

const char * getParameterSwitchItem (int num, int item)

Returns a string value for a switch item of a given parameter.

Arguments

  • int num - Number of the target parameter.
  • int item - Number of the target item.

Return value

Value of the item or NULL (0), if an error occurred.

Ptr<Property> clone (const char * name)

Clones the property.

Arguments

  • const char * name - New property name.

Return value

Cloned property smart pointer.

int findState (const char * name, int fast_id)

Searches a state by its name.

Arguments

  • const char * name - State name.
  • int fast_id - State's fast identifier (hash of a name).

Return value

State number.

int getIntersection ()

Gets the intersection option: a value indicating if intersection test is enabled for objects with the assigned property. The object will collide only if it has the surface intersection flag and the property intersection flag at the same time.

Return value

The intersection option.

void setParameterDouble (int num, double value)

Sets a value for the given double parameter.

Arguments

  • int num - Parameter number.
  • double value - Parameter value.

int loadWorld (const Ptr<Xml> & xml)

Loads property settings from the Xml.

Arguments

  • const Ptr<Xml> & xml - Xml smart pointer.

Return value

1 if the property settings are loaded successfully; otherwise, 0.

int restoreState (const Ptr<Stream> & stream, int force = 0)

Restores property settings from the stream.

Arguments

  • const Ptr<Stream> & stream - Stream smart pointer.
  • int force - Forced restoring of property settings.

Return value

1 if the property settings are restored successfully; otherwise, 0.

const char * getName ()

Returns a property name.

Return value

Property name.

int isHidden ()

Returns a value indicating if the property is hidden.

Return value

1 if the property is hidden; otherwise, 0.

int getStateType (int num)

Returns the property's state type.

Arguments

  • int num - The state number.

Return value

State type.

void setParameterMask (int num, int value)

Updates the value of a given mask parameter.

Arguments

  • int num - Number of the target parameter in range from 0 to the total number of parameters.
  • int value - New value of the mask parameter.

int getNumParameters ()

Returns the number of property's parameters.

Return value

Number of parameters.

double getParameterDoubleMaxValue (int num)

Returns the maximum allowed value of a double parameter.

Arguments

  • int num - Number of the target parameter.

Return value

Maximum value.

Math::vec4 getParameterColor (int num)

Gets a value of the given color parameter.

Arguments

  • int num - Parameter number.

Return value

Parameter value.

int getParameterType (int num)

Returns the property's parameter type.

Arguments

  • int num - The parameter number.

Return value

State type.

int getNumChildren ()

Returns the number of child properties.

Return value

The number of child properties.

int findParameter (const char * name)

Searches a parameter by its name.

Arguments

  • const char * name - Parameter name.

Return value

Parameter number.

Ptr<Property> getParent ()

Returns the parent property smart pointer.

Return value

Parent property smart pointer.

int getParameterInt (int num)

Gets the value of the given integer parameter.

Arguments

  • int num - Parameter number.

Return value

Parameter value.

int getParameterSliderMaxExpand (int num)

Returns a value indicating if the maximum value of a given parameter can be increased.

Arguments

  • int num - Number of the target parameter.

Return value

Positive number if the maximum value can be changed; otherwise, 0.

Ptr<Property> inherit (const char * name)

Inherits the property.

Arguments

  • const char * name - New property name.

Return value

Inherited property smart pointer.

double getParameterDouble (int num)

Gets the value of the given double parameter.

Arguments

  • int num - Parameter number.

Return value

Parameter value.

int getParameterIntMaxValue (int num)

Returns the maximum allowed value of an integer parameter.

Arguments

  • int num - Number of the target parameter.

Return value

Maximum value.

int isParent (const char * name)

Returns a value indicating if the property is a parent one.

Arguments

  • const char * name - Property name.

Return value

1 if the property is a parent property.

void setParameterToggle (int num, int value)

Sets a value for the given toggle parameter.

Arguments

  • int num - Parameter number.
  • int value - Parameter value.

const char * getParameterString (int num)

Gets a value of the given string parameter.

Arguments

  • int num - Parameter number.

Return value

Parameter value.

bool setParameter (int num, const Variable & value)

Updates the value of a given parameter.

Arguments

  • int num - Parameter to be updated. It can either be:
    • int - Number of the target parameter.
    • string - name of the target parameter.
  • const Variable & value - New value of the parameter.

Return value

float getParameterFloat (int num)

Gets the value of the given float parameter.

Arguments

  • int num - Parameter number.

Return value

Parameter value.

Ptr<Property> getCompare ()

Returns the compare property smart pointer.

Return value

Compare property smart pointer.

const char * getStateName (int num)

Returns the property's state name.

Arguments

  • int num - The state number.

Return value

State name.

int getState (int num)

Gets the value of the given state.

Arguments

  • int num - State number.

Return value

State value.

int getParameterSliderLog10 (int num)

Returns a value indicating if a given parameter uses a logarithmic scale (with the base ten).

Arguments

  • int num - Number of the target parameter.

Return value

Positive number if the parameter uses a logarithmic scale; otherwise, 0.

float getParameterFloatMaxValue (int num)

Returns the maximum allowed value of a float parameter.

Arguments

  • int num - Number of the target parameter.

Return value

Maximum value.

int getParameterToggle (int num)

Gets the value of the given toggle parameter.

Arguments

  • int num - Parameter number.

Return value

Parameter value.

Ptr<Property> getChild (int num)

Returns the child property.

Arguments

  • int num - The child number.

Return value

The child property smart pointer.

int getParameterSwitch (int num)

Gets a value of the given switch parameter.

Arguments

  • int num - Parameter number.

Return value

Parameter value.

int isEditable ()

Returns a value indicating if the property is editable.

Return value

1 if the property is editable; otherwise, 0.

int saveState (const Ptr<Stream> & stream, int force = 0)

Saves property settings into the stream.

Arguments

  • const Ptr<Stream> & stream - Stream smart pointer.
  • int force - Forced saving of property settings.

Return value

1 if the property settings are saved successfully; otherwise, 0.

void setParameterVec3 (int num, const Math::vec3 & value)

Sets a value for the given vec3 parameter.

Arguments

  • int num - Parameter number.
  • const Math::vec3 & value - Parameter value.

Variable getParameter (int num)

Returns the value of a given parameter.

Arguments

  • int num - Parameter to be updated. It can either be:
    • int - Number of the target parameter.
    • string - name of the target parameter.

Return value

Parameter value.

Math::vec3 getParameterVec3 (int num)

Gets a value of the given vec3 parameter.

Arguments

  • int num - Parameter number.

Return value

Parameter value.

float getParameterFloatMinValue (int num)

Returns the minimum allowed value of a float parameter.

Arguments

  • int num - Number of the target parameter.

Return value

Minimum value.

void setState (int num, int value)

Sets the value for the given state.

Arguments

  • int num - State number.
  • int value - State value.

int isStateHidden (int num)

Returns a value indicating if the state is hidden.

Arguments

  • int num - The state number.

Return value

1 if the state is hidden; otherwise, 0.

double getParameterDoubleMinValue (int num)

Returns the minimum allowed value of a double parameter.

Arguments

  • int num - Number of the target parameter.

Return value

Minimum value.

int getStateSwitchNumItems (int num)

Returns the number of switch item names.

Arguments

  • int num - State number.

Return value

Number of switch item names.

const char * getStateSwitchItem (int num, int item)

Returns the switch item name.

Arguments

  • int num - State number.
  • int item - Item number.

Return value

Switch item name.

int findParameter (const char * name, int fast_id)

Searches a parameter by its name.

Arguments

  • const char * name - Parameter name.
  • int fast_id - Parameter's fast identifier (hash of a name).

Return value

Parameter number.

void setIntersection (int enable)

Sets the intersection option: a value indicating if intersection test is enabled for objects with the assigned property. The object will collide only if it has the surface intersection flag and the property intersection flag at the same time.

Arguments

  • int enable - The intersection option.

int getCollision ()

Gets the collision option: a value indicating if collision test is enabled for objects with the assigned property.

Return value

The collision option.

void setParameterColor (int num, const Math::vec4 & value)

Sets a value for the given color parameter.

Arguments

  • int num - Parameter number.
  • const Math::vec4 & value - Parameter value.

void setParameterFloat (int num, float value)

Sets a value for the given float parameter.

Arguments

  • int num - Parameter number.
  • float value - Parameter value.

int getParameterSwitchNumItems (int num)

Returns the number of switch items of a given parameter.

Arguments

  • int num - Number of the target parameter.

Return value

Number of switch items.

const char * getParameterName (int num)

Returns the property's parameter name.

Arguments

  • int num - The parameter number.

Return value

State name.

void setParameterSwitch (int num, int value)

Sets a value for the given switch parameter.

Arguments

  • int num - Parameter number.
  • int value - Parameter value.

int isParameterHidden (int num)

Returns a value indicating if the parameter is hidden.

Arguments

  • int num - The parameter number.

Return value

1 is the parameter is hidden; otherwise, 0.

int getParameterStringFile (int num)

Returns a value indicating if a given string parameter has a file flag. For example, it is used in the Properties Editor: it allows you to specify the file for the parameter by the double-click.

Arguments

  • int num - Number of the target parameter.

Return value

1 if the target parameter has a file flag; otherwise 0.

int findState (const char * name)

Searches a state by its name.

Arguments

  • const char * name - State name.

Return value

State number.

void setParameterVec4 (int num, const Math::vec4 & value)

Sets a value for the given vec4 parameter.

Arguments

  • int num - Parameter number.
  • const Math::vec4 & value - Parameter value.

int saveWorld (const Ptr<Xml> & xml, int force = 0)

Saves property settings into the Xml.

Arguments

  • const Ptr<Xml> & xml - Xml smart pointer.
  • int force - Forced saving of property settings.

Return value

1 if the property settings are saved successfully; otherwise, 0.

void setParameterString (int num, const char * value)

Sets a value for the given string parameter.

Arguments

  • int num - Parameter number.
  • const char * value - Parameter value.

int getParameterSliderMinExpand (int num)

Returns a value indicating if the minimum value of a given parameter can be decreased.

Arguments

  • int num - Number of the target parameter.

Return value

Positive number if the minimum value can be changed; otherwise, 0.

void setCollision (int enable)

Sets the collision option: a value indicating if collision test is enabled for objects with the assigned property. The object will collide only if it has collider node flag (can be checked via Unigine::Node::isCollider()), surface collision flag (set via Unigine::Object::setCollision()) and property collision flag at the same time.

Arguments

  • int enable - The collision option.

int getNumStates ()

Returns the number of property's states.

Return value

The number of states.

void setParameterInt (int num, int value)

Sets a value for the given integer parameter.

Arguments

  • int num - Parameter number.
  • int value - Parameter value.

int STATE_TOGGLE

Description

State of this type allows only two possible values.

int STATE_SWITCH

Description

State of this type allows specifying a set of several possible values (more than two).

int PARAMETER_INT

Description

Parameter of this type accepts any integer value in a given range.

int PARAMETER_FLOAT

Description

Parameter of this type accepts any float value in a given range.

int PARAMETER_DOUBLE

Description

Parameter of this type accepts any double value in a given range.

int PARAMETER_TOGGLE

Description

Parameter of this type allows only two possible values.

int PARAMETER_SWITCH

Description

Parameter of this type allows specifying a set of several possible values (more than two).

int PARAMETER_STRING

Description

Parameter of this type accepts any string value.

int PARAMETER_COLOR

Description

Parameter of this type allows specifying the material color.

int PARAMETER_VEC3

Description

Parameter of this type accepts any vec3 value.

int PARAMETER_VEC4

Description

Parameter of this type accepts any vec4 value.

int PARAMETER_MASK

Description

Parameter of this type allows specifying a mask.

int PARAMETER_AUX

Description

Parameter of the auxiliary type.

int STATE_AUX

Description

State of the auxiliary type.
Last update: 2017-07-03
Build: ()