UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Migration
Migrating to UNIGINE 2.0
C++ API Migration
Migrating from UNIGINE 2.0 to UNIGINE 2.1

Unigine::Property Class

Interface for property manipulation.

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

Unigine::Property Class

Members


virtual ~Property ()

Virtual destructor.

virtual void grab () =0

Grabs Property (sets the owner flag to 1 for the pointer). The Property should not be handled by the engine after this function is called.

virtual void release () =0

Releases Property (sets the owner flag to 0 for the pointer). The Property should be handled by the engine after this function is called.

virtual int isOwner () const =0

Return the owner flag. If the pointer is the owner, on its deletion the material also will be deleted. Use grab() and release() functions to change ownership.

Return value

Returns the owner flag.

virtual int isHidden () const =0

Returns a value indicating if the property is hidden.

Return value

1 if the property is hidden; otherwise, 0.

virtual int isEditable () const =0

Returns a value indicating if the property is editable.

Return value

1 if the property is editable; otherwise, 0.

virtual const char * getName () const =0

Returns a property name.

Return value

Property name.

virtual Ptr< Property > getParent () const =0

Returns the parent property smart pointer.

Return value

Parent property smart pointer.

virtual Ptr< Property > getCompare () const =0

Returns the compare property smart pointer.

Return value

Compare property smart pointer.

virtual int getNumChilds () const =0

Returns the number of child properties.
Warning
The function is deprecated. It is provided to keep your code working until the next release. Please, replace it with getNumChildren().

Return value

The number of child properties.

virtual int getNumChildren () const =0

Returns the number of child properties.

Return value

The number of child properties.

virtual Ptr< Property > getChild (int num) const =0

Returns the child property.

Arguments

  • int num - The child number.

Return value

The child property smart pointer.

virtual int isParent (const char * name) const =0

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.

virtual Ptr< Property > clone (const char * name) const =0

Clones the property.

Arguments

  • const char * name - New property name.

Return value

Cloned property smart pointer.

virtual Ptr< Property > inherit (const char * name) const =0

Inherits the property.

Arguments

  • const char * name - New property name.

Return value

Inherited property smart pointer.

virtual void setIntersection (int enable) const =0

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.

virtual int getIntersection () const =0

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.

virtual void setCollision (int enable) const =0

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.

virtual int getCollision () const =0

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

Return value

The collision option.

virtual int getNumStates () const =0

Returns the number of property's states.

Return value

The number of states.

virtual const char * getStateName (int num) const =0

Returns the property's state name.

Arguments

  • int num - The state number.

Return value

State name.

virtual int getStateType (int num) const =0

Returns the property's state type.

Arguments

  • int num - The state number.

Return value

State type.

virtual int isStateHidden (int num) const =0

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.

virtual int findState (const char * name) const =0

Searches a state by its name.

Arguments

  • const char * name - State name.

Return value

State number.

virtual int findState (const char * name, int fast_id) const =0

Searches a state by its name and a fast identifier.

Arguments

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

Return value

State number.

virtual void setState (int num, int value) const =0

Sets the value for the given state.

Arguments

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

virtual int getState (int num) const =0

Gets the value of the given state.

Arguments

  • int num - State number.

Return value

State value.

virtual int getStateSwitchNumItems (int num) const =0

Returns the number of switch item names.

Arguments

  • int num - State number.

Return value

Number of switch item names.

virtual const char * getStateSwitchItem (int num, int item) const =0

Returns the switch item name.

Arguments

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

Return value

Switch item name.

virtual int getNumParameters () const =0

Returns the number of property's parameters.

Return value

Number of parameters.

virtual const char * getParameterName (int num) const =0

Returns the property's parameter name.

Arguments

  • int num - The parameter number.

Return value

State name.

virtual int getParameterType (int num) const =0

Returns the property's parameter type.

Arguments

  • int num - The parameter number.

Return value

State type.

virtual int isParameterHidden (int num) const =0

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.

virtual int findParameter (const char * name) const =0

Searches a parameter by its name.

Arguments

  • const char * name - Parameter name.

Return value

Parameter number.

virtual int findParameter (const char * name, int fast_id) const =0

Searches a parameter by its name and a fast identifier.

Arguments

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

Return value

Parameter number.

virtual void setParameterInt (int num, int value) const =0

Sets a value for the given integer parameter.

Arguments

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

virtual int getParameterInt (int num) const =0

Gets the value of the given integer parameter.

Arguments

  • int num - Parameter number.

Return value

Parameter value.

virtual void setParameterFloat (int num, float value) const =0

Sets a value for the given float parameter.

Arguments

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

virtual float getParameterFloat (int num) const =0

Gets the value of the given float parameter.

Arguments

  • int num - Parameter number.

Return value

Parameter value.

virtual void setParameterDouble (int num, double value) const =0

Sets a value for the given double parameter.

Arguments

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

virtual double getParameterDouble (int num) const =0

Gets the value of the given double parameter.

Arguments

  • int num - Parameter number.

Return value

Parameter value.

virtual void setParameterToggle (int num, int value) const =0

Sets a value for the given toggle parameter.

Arguments

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

virtual int getParameterToggle (int num) const =0

Gets the value of the given toggle parameter.

Arguments

  • int num - Parameter number.

Return value

Parameter value.

virtual void setParameterSwitch (int num, int value) const =0

Sets a value for the given switch parameter.

Arguments

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

virtual int getParameterSwitch (int num) const =0

Gets a value of the given switch parameter.

Arguments

  • int num - Parameter number.

Return value

Parameter value.

virtual void setParameterString (int num, const char * value) const =0

Sets a value for the given string parameter.

Arguments

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

virtual String getParameterString (int num) const =0

Gets a value of the given string parameter.

Arguments

  • int num - Parameter number.

Return value

Parameter value.

virtual void setParameterColor (int num, const vec4 & value) const =0

Sets a value for the given color parameter.

Arguments

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

virtual vec4 getParameterColor (int num) const =0

Gets a value of the given color parameter.

Arguments

  • int num - Parameter number.

Return value

Parameter value.

virtual void setParameterVec3 (int num, const vec3 & value) const =0

Sets a value for the given vec3 parameter.

Arguments

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

virtual vec3 getParameterVec3 (int num) const =0

Gets a value of the given vec3 parameter.

Arguments

  • int num - Parameter number.

Return value

Parameter value.

virtual void setParameterVec4 (int num, const vec4 & value) const =0

Sets a value for the given vec4 parameter.

Arguments

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

virtual vec4 getParameterVec4 (int num) const =0

Gets a value of the given vec4 parameter.

Arguments

  • int num - Parameter number.

Return value

Parameter value.

virtual void setParameterMask (int num, int value) const =0

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.

virtual int getParameterMask (int num) const =0

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.

virtual int loadWorld (const XmlPtr & xml) const =0

Loads property settings from the Xml.

Arguments

  • const XmlPtr & xml - Xml smart pointer.

Return value

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

virtual int saveWorld (const XmlPtr & xml, int force) const =0

Saves property settings into the Xml.

Arguments

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

Return value

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

virtual int saveState (const StreamPtr & stream, int force) const =0

Saves property settings into the stream.

Arguments

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

Return value

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

virtual int restoreState (const StreamPtr & stream, int force) const =0

Restores property settings from the stream.

Arguments

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

Return value

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

Unigine::Property::anonymous_91 Enumeration

STATE_TOGGLE = 0
STATE_SWITCH

Unigine::Property::anonymous_92 Enumeration

PARAMETER_INT = 0
PARAMETER_FLOAT
PARAMETER_DOUBLE
PARAMETER_TOGGLE
PARAMETER_SWITCH
PARAMETER_STRING
PARAMETER_COLOR
PARAMETER_VEC3
PARAMETER_VEC4
PARAMETER_MASK
Last update: 2017-07-03