Editor API
UnigineEditor public API
UnigineEditor::ObjectMode Class Reference

This class allows configuring the widget that controls objects selection and positioning in the scene. More...

Public Types

enum  TRANSFORM_TYPE {
  TRANSFORM_TYPE_SELECT = 0, TRANSFORM_TYPE_TRANSLATE, TRANSFORM_TYPE_ROTATE, TRANSFORM_TYPE_SCALE,
  TRANSFORM_TYPE_NUM
}
 Type of transformation applied to the node selected by the manipulator. More...
 
enum  BASIS_TYPE {
  BASIS_TYPE_WORLD = 0, BASIS_TYPE_PARENT, BASIS_TYPE_LOCAL_LAST_SELECTED, BASIS_TYPE_LOCAL_INDEPENDENT,
  BASIS_TYPE_NUM
}
 Type of the coordinate system used. More...
 
enum  PIVOT_TYPE { PIVOT_TYPE_CENTER = 0, PIVOT_TYPE_OBJECT, PIVOT_TYPE_NUM }
 Type of the pivot used for rotation of the selected nodes. More...
 
enum  GRID_MODE { GRID_MODE_BOUND_BOX = 0, GRID_MODE_UNIFORM, GRID_MODE_NUM }
 Type of node positioning: moving over the grid with a given step or with a step equal to the dimensions of node's bounding box. More...
 
enum  DROP_DIRECTION { DROP_DIRECTION_UP = 0, DROP_DIRECTION_DOWN, DROP_DIRECTION_UP_AND_DOWN, DROP_DIRECTION_NUM }
 Direction of dropping the node. More...
 

Static Public Member Functions

static bool isEnabled ()
 Returns the value indicating if the object mode is enabled. More...
 
static void setManipulatorsEnabled (bool enabled)
 Returns the value indicating if the manipulators are enabled. More...
 
static bool isManipulatorsEnabled ()
 Returns the value indicating if the manipulators are enabled. More...
 
static bool isTransformTypeEnabled (ObjectMode::TRANSFORM_TYPE type)
 Returns the value indicating if the specified type of transformation is enabled. More...
 
static bool isBasisEnabled ()
 Returns the value indicating if the basis is enabled. More...
 
static void setTransformType (ObjectMode::TRANSFORM_TYPE type)
 Sets the type of transformation applied to the node(s) selected by the manipulator. More...
 
static ObjectMode::TRANSFORM_TYPE getTransformType ()
 Returns the type of transformation applied to the node(s) selected by the manipulator. More...
 
static void setBasisType (ObjectMode::BASIS_TYPE type)
 Sets the type of basis applied to the node(s) selected by the manipulator. More...
 
static ObjectMode::BASIS_TYPE getBasisType ()
 Returns the type of basis applied to the node(s) selected by the manipulator. More...
 
static void setPivotType (ObjectMode::PIVOT_TYPE type)
 Sets the type of pivot applied to the node(s) selected by the manipulator. More...
 
static ObjectMode::PIVOT_TYPE getPivotType ()
 Returns the type of pivot applied to the node(s) selected by the manipulator. More...
 
static void setPositionSnappingEnabled (bool enabled)
 Sets the value indicating if the position snapping is enabled. More...
 
static bool isPositionSnappingEnabled ()
 Returns the value indicating if the position snapping is enabled. More...
 
static void setPositionSnappingMode (ObjectMode::GRID_MODE mode)
 Sets the mode of position snapping applied to the node(s) selected by the manipulator. More...
 
static ObjectMode::GRID_MODE getPositionSnappingMode ()
 Returns the mode of position snapping applied to the node(s) selected by the manipulator. More...
 
static void setPositionSnappingByGridStep (float step)
 Sets the step value for position snapping, if the mode is set to grid (see PositionSnappingMode). More...
 
static float getPositionSnappingByGridStep ()
 Returns the step value for position snapping, if the mode is set to grid (see PositionSnappingMode). More...
 
static void setRotationSnappingEnabled (bool enabled)
 Sets the value indicating if the rotation snapping is enabled. More...
 
static bool isRotationSnappingEnabled ()
 Returns the value indicating if the rotation snapping is enabled. More...
 
static void setRotationSnappingStep (float step)
 Sets the step value for rotation snapping (see RotationSnappingEnabled). More...
 
static float getRotationSnappingStep ()
 Returns the step value for rotation snapping (see RotationSnappingEnabled). More...
 
static void setScaleSnappingEnabled (bool enabled)
 Sets the value indicating if scale snapping is enabled. More...
 
static bool isScaleSnappingEnabled ()
 Returns the value indicating if scale snapping is enabled. More...
 
static void setScaleSnappingStep (float step)
 Sets the step value for scale snapping (see ScaleSnappingEnabled). More...
 
static float getScaleSnappingStep ()
 Returns the step value for scale snapping (see ScaleSnappingEnabled). More...
 
static bool isSnapToSurfaceEnabled ()
 Returns the value indicating if snapping to surface is enabled. More...
 
static void setSnapToSurfaceOffset (float offset)
 Sets the offset applied when snapping a node to the surface (see isSnapToSurfaceEnabled). More...
 
static float getSnapToSurfaceOffset ()
 Returns the offset applied when snapping a node to the surface (see isSnapToSurfaceEnabled). More...
 
static void setSnapToSurfaceOrientByNormal (bool normal)
 Sets the value indicating if the node should be oriented by the surface normal, when snapping a node to the surface (see isSnapToSurfaceEnabled). More...
 
static bool isSnapToSurfaceOrientByNormal ()
 Returns the value indicating if the node should be oriented by the surface normal, when snapping a node to the surface (see isSnapToSurfaceEnabled). More...
 
static void setSnapToSurfaceToNodesWithEnabledIntersection (bool intersection)
 Sets the value indicating if the node should be snapped to the surface with the Intersection parameter enabled. More...
 
static bool isSnapToSurfaceToNodesWithEnabledIntersection ()
 Returns the value indicating if the node should be snapped to the surface with the Intersection parameter enabled. More...
 
static void snapToSurfaceNode (const Unigine::Ptr< Unigine::Node > &node)
 Snaps the specified node to surface. More...
 
static void snapToSurfaceNodeList (const Unigine::Vector< Unigine::Ptr< Unigine::Node >> &nodes)
 Snaps the nodes from the specified list to surface. More...
 
static void setDropToGroundDirection (ObjectMode::DROP_DIRECTION direction)
 Sets the direction of dropping applied to the node(s) selected by the manipulator. More...
 
static ObjectMode::DROP_DIRECTION getDropToGroundDirection ()
 Returns the direction of dropping applied to the node(s) selected by the manipulator. More...
 
static void setDropToGroundOffset (float offset)
 Sets the offset applied when dropping a node to the ground. More...
 
static float getDropToGroundOffset ()
 Returns the offset applied when dropping a node to the ground. More...
 
static void setDropToGroundOrientByNormal (bool normal)
 Sets the value indicating if the node should be oriented by the ground normal, when dropped to the ground. More...
 
static bool isDropToGroundOrientByNormal ()
 Returns the value indicating if the node should be oriented by the ground normal, when dropped to the ground. More...
 
static void setDropToGroundMask (int mask)
 Sets the intersection mask that defines whether the selected node(s) will be positioned on the surface to which this node(s) is dropped. More...
 
static int getDropToGroundMask ()
 Returns the intersection mask that defines whether the selected node(s) will be positioned on the surface to which this node(s) is dropped. More...
 
static void setDropToGroundToNodesWithEnabledIntersection (bool intersection)
 Sets the value indicating if the node should be dropped to the ground if it has the Intersection parameter enabled. More...
 
static bool isDropToGroundToNodesWithEnabledIntersection ()
 Returns the value indicating if the node should be dropped to the ground if it has the Intersection parameter enabled. More...
 
static void dropToGroundNode (const Unigine::Ptr< Unigine::Node > &node)
 Drops the specified node to the ground. More...
 
static void dropToGroundNodeList (const Unigine::Vector< Unigine::Ptr< Unigine::Node >> &nodes)
 Drops the nodes from the specified list to the ground. More...
 

Detailed Description

This class allows configuring the widget that controls objects selection and positioning in the scene.

Member Enumeration Documentation

◆ BASIS_TYPE

Type of the coordinate system used.

Enumerator
BASIS_TYPE_WORLD 

World coordinate system.

BASIS_TYPE_PARENT 

Parent node coordinate system.

BASIS_TYPE_LOCAL_LAST_SELECTED 

Local coordinate system of the last selected node.

BASIS_TYPE_LOCAL_INDEPENDENT 

Individual local coordinate system for each node in selection.

BASIS_TYPE_NUM 

Total number of basis types.

◆ DROP_DIRECTION

Direction of dropping the node.

Enumerator
DROP_DIRECTION_UP 

Node is placed onto the closest surface above it.

DROP_DIRECTION_DOWN 

Node is placed onto the closest surface below it.

DROP_DIRECTION_UP_AND_DOWN 

Node is placed onto the closest surface either above or below it.

DROP_DIRECTION_NUM 

Total number of dropping direction types.

◆ GRID_MODE

Type of node positioning: moving over the grid with a given step or with a step equal to the dimensions of node's bounding box.

Enumerator
GRID_MODE_BOUND_BOX 

Node positioning is performed with a step equal to the dimensions of node's bounding box.

GRID_MODE_UNIFORM 

Node positioning is performed by moving over the grid with a given step.

GRID_MODE_NUM 

Total number of positioning types.

◆ PIVOT_TYPE

Type of the pivot used for rotation of the selected nodes.

Enumerator
PIVOT_TYPE_CENTER 

Pivot point is in the center of selection.

PIVOT_TYPE_OBJECT 

Pivot point is set to the center of the last selected node.

PIVOT_TYPE_NUM 

Total number of pivot types.

◆ TRANSFORM_TYPE

Type of transformation applied to the node selected by the manipulator.

Enumerator
TRANSFORM_TYPE_SELECT 

Node selection.

TRANSFORM_TYPE_TRANSLATE 

Node positioning.

TRANSFORM_TYPE_ROTATE 

Node rotation.

TRANSFORM_TYPE_SCALE 

Node scaling.

TRANSFORM_TYPE_NUM 

Total number of transformation types.

Member Function Documentation

◆ dropToGroundNode()

static void UnigineEditor::ObjectMode::dropToGroundNode ( const Unigine::Ptr< Unigine::Node > &  node)
static

Drops the specified node to the ground.

Parameters
nodeNode to be dropped to the ground.

◆ dropToGroundNodeList()

static void UnigineEditor::ObjectMode::dropToGroundNodeList ( const Unigine::Vector< Unigine::Ptr< Unigine::Node >> &  nodes)
static

Drops the nodes from the specified list to the ground.

Parameters
nodesList of nodes to be dropped to the ground.

◆ getBasisType()

static ObjectMode::BASIS_TYPE UnigineEditor::ObjectMode::getBasisType ( )
static

Returns the type of basis applied to the node(s) selected by the manipulator.

◆ getDropToGroundDirection()

static ObjectMode::DROP_DIRECTION UnigineEditor::ObjectMode::getDropToGroundDirection ( )
static

Returns the direction of dropping applied to the node(s) selected by the manipulator.

◆ getDropToGroundMask()

static int UnigineEditor::ObjectMode::getDropToGroundMask ( )
static

Returns the intersection mask that defines whether the selected node(s) will be positioned on the surface to which this node(s) is dropped.

◆ getDropToGroundOffset()

static float UnigineEditor::ObjectMode::getDropToGroundOffset ( )
static

Returns the offset applied when dropping a node to the ground.

◆ getPivotType()

static ObjectMode::PIVOT_TYPE UnigineEditor::ObjectMode::getPivotType ( )
static

Returns the type of pivot applied to the node(s) selected by the manipulator.

◆ getPositionSnappingByGridStep()

static float UnigineEditor::ObjectMode::getPositionSnappingByGridStep ( )
static

Returns the step value for position snapping, if the mode is set to grid (see PositionSnappingMode).

◆ getPositionSnappingMode()

static ObjectMode::GRID_MODE UnigineEditor::ObjectMode::getPositionSnappingMode ( )
static

Returns the mode of position snapping applied to the node(s) selected by the manipulator.

◆ getRotationSnappingStep()

static float UnigineEditor::ObjectMode::getRotationSnappingStep ( )
static

Returns the step value for rotation snapping (see RotationSnappingEnabled).

◆ getScaleSnappingStep()

static float UnigineEditor::ObjectMode::getScaleSnappingStep ( )
static

Returns the step value for scale snapping (see ScaleSnappingEnabled).

◆ getSnapToSurfaceOffset()

static float UnigineEditor::ObjectMode::getSnapToSurfaceOffset ( )
static

Returns the offset applied when snapping a node to the surface (see isSnapToSurfaceEnabled).

◆ getTransformType()

static ObjectMode::TRANSFORM_TYPE UnigineEditor::ObjectMode::getTransformType ( )
static

Returns the type of transformation applied to the node(s) selected by the manipulator.

◆ isBasisEnabled()

static bool UnigineEditor::ObjectMode::isBasisEnabled ( )
static

Returns the value indicating if the basis is enabled.

◆ isDropToGroundOrientByNormal()

static bool UnigineEditor::ObjectMode::isDropToGroundOrientByNormal ( )
static

Returns the value indicating if the node should be oriented by the ground normal, when dropped to the ground.

◆ isDropToGroundToNodesWithEnabledIntersection()

static bool UnigineEditor::ObjectMode::isDropToGroundToNodesWithEnabledIntersection ( )
static

Returns the value indicating if the node should be dropped to the ground if it has the Intersection parameter enabled.

◆ isEnabled()

static bool UnigineEditor::ObjectMode::isEnabled ( )
static

Returns the value indicating if the object mode is enabled.

◆ isManipulatorsEnabled()

static bool UnigineEditor::ObjectMode::isManipulatorsEnabled ( )
static

Returns the value indicating if the manipulators are enabled.

◆ isPositionSnappingEnabled()

static bool UnigineEditor::ObjectMode::isPositionSnappingEnabled ( )
static

Returns the value indicating if the position snapping is enabled.

◆ isRotationSnappingEnabled()

static bool UnigineEditor::ObjectMode::isRotationSnappingEnabled ( )
static

Returns the value indicating if the rotation snapping is enabled.

◆ isScaleSnappingEnabled()

static bool UnigineEditor::ObjectMode::isScaleSnappingEnabled ( )
static

Returns the value indicating if scale snapping is enabled.

◆ isSnapToSurfaceEnabled()

static bool UnigineEditor::ObjectMode::isSnapToSurfaceEnabled ( )
static

Returns the value indicating if snapping to surface is enabled.

◆ isSnapToSurfaceOrientByNormal()

static bool UnigineEditor::ObjectMode::isSnapToSurfaceOrientByNormal ( )
static

Returns the value indicating if the node should be oriented by the surface normal, when snapping a node to the surface (see isSnapToSurfaceEnabled).

◆ isSnapToSurfaceToNodesWithEnabledIntersection()

static bool UnigineEditor::ObjectMode::isSnapToSurfaceToNodesWithEnabledIntersection ( )
static

Returns the value indicating if the node should be snapped to the surface with the Intersection parameter enabled.

◆ isTransformTypeEnabled()

static bool UnigineEditor::ObjectMode::isTransformTypeEnabled ( ObjectMode::TRANSFORM_TYPE  type)
static

Returns the value indicating if the specified type of transformation is enabled.

Parameters
typeType of transformation (see TRANSFORM_TYPE).

◆ setBasisType()

static void UnigineEditor::ObjectMode::setBasisType ( ObjectMode::BASIS_TYPE  type)
static

Sets the type of basis applied to the node(s) selected by the manipulator.

Parameters
typeType of basis to be set (see BASIS_TYPE).

◆ setDropToGroundDirection()

static void UnigineEditor::ObjectMode::setDropToGroundDirection ( ObjectMode::DROP_DIRECTION  direction)
static

Sets the direction of dropping applied to the node(s) selected by the manipulator.

Parameters
directionDirection of dropping to be set (see DROP_DIRECTION).

◆ setDropToGroundMask()

static void UnigineEditor::ObjectMode::setDropToGroundMask ( int  mask)
static

Sets the intersection mask that defines whether the selected node(s) will be positioned on the surface to which this node(s) is dropped.

Parameters
maskIntersection mask that should match the surface intersection mask for the node to be dropped onto that surface.

◆ setDropToGroundOffset()

static void UnigineEditor::ObjectMode::setDropToGroundOffset ( float  offset)
static

Sets the offset applied when dropping a node to the ground.

Parameters
offsetDistance from the node's pivot point to the ground (in units).

◆ setDropToGroundOrientByNormal()

static void UnigineEditor::ObjectMode::setDropToGroundOrientByNormal ( bool  normal)
static

Sets the value indicating if the node should be oriented by the ground normal, when dropped to the ground.

Parameters
normalValue indicating if the node should be oriented by the ground normal.

◆ setDropToGroundToNodesWithEnabledIntersection()

static void UnigineEditor::ObjectMode::setDropToGroundToNodesWithEnabledIntersection ( bool  intersection)
static

Sets the value indicating if the node should be dropped to the ground if it has the Intersection parameter enabled.

Parameters
intersectionValue indicating if the node is snapped to the ground if it has the Intersection parameter enabled.

◆ setManipulatorsEnabled()

static void UnigineEditor::ObjectMode::setManipulatorsEnabled ( bool  enabled)
static

Returns the value indicating if the manipulators are enabled.

◆ setPivotType()

static void UnigineEditor::ObjectMode::setPivotType ( ObjectMode::PIVOT_TYPE  type)
static

Sets the type of pivot applied to the node(s) selected by the manipulator.

Parameters
typeType of pivot to be set (see PIVOT_TYPE).

◆ setPositionSnappingByGridStep()

static void UnigineEditor::ObjectMode::setPositionSnappingByGridStep ( float  step)
static

Sets the step value for position snapping, if the mode is set to grid (see PositionSnappingMode).

Parameters
stepThe position step, in units.

◆ setPositionSnappingEnabled()

static void UnigineEditor::ObjectMode::setPositionSnappingEnabled ( bool  enabled)
static

Sets the value indicating if the position snapping is enabled.

Parameters
enabledValue indicating if the position snapping is enabled.

◆ setPositionSnappingMode()

static void UnigineEditor::ObjectMode::setPositionSnappingMode ( ObjectMode::GRID_MODE  mode)
static

Sets the mode of position snapping applied to the node(s) selected by the manipulator.

Parameters
modeMode of position snapping to be set (see GRID_MODE).

◆ setRotationSnappingEnabled()

static void UnigineEditor::ObjectMode::setRotationSnappingEnabled ( bool  enabled)
static

Sets the value indicating if the rotation snapping is enabled.

Parameters
enabledValue indicating if the rotation snapping is enabled.

◆ setRotationSnappingStep()

static void UnigineEditor::ObjectMode::setRotationSnappingStep ( float  step)
static

Sets the step value for rotation snapping (see RotationSnappingEnabled).

Parameters
stepRotation step, angle in degrees.

◆ setScaleSnappingEnabled()

static void UnigineEditor::ObjectMode::setScaleSnappingEnabled ( bool  enabled)
static

Sets the value indicating if scale snapping is enabled.

Parameters
enabledValue indicating if scale snapping is enabled.

◆ setScaleSnappingStep()

static void UnigineEditor::ObjectMode::setScaleSnappingStep ( float  step)
static

Sets the step value for scale snapping (see ScaleSnappingEnabled).

Parameters
stepScale step.

◆ setSnapToSurfaceOffset()

static void UnigineEditor::ObjectMode::setSnapToSurfaceOffset ( float  offset)
static

Sets the offset applied when snapping a node to the surface (see isSnapToSurfaceEnabled).

Parameters
offsetDistance from the node's pivot point to the surface (in units).

◆ setSnapToSurfaceOrientByNormal()

static void UnigineEditor::ObjectMode::setSnapToSurfaceOrientByNormal ( bool  normal)
static

Sets the value indicating if the node should be oriented by the surface normal, when snapping a node to the surface (see isSnapToSurfaceEnabled).

Parameters
normalValue indicating if the node should be oriented by the surface normal.

◆ setSnapToSurfaceToNodesWithEnabledIntersection()

static void UnigineEditor::ObjectMode::setSnapToSurfaceToNodesWithEnabledIntersection ( bool  intersection)
static

Sets the value indicating if the node should be snapped to the surface with the Intersection parameter enabled.

Parameters
intersectionValue indicating if the node is snapped to the surface with Intersection enabled.

◆ setTransformType()

static void UnigineEditor::ObjectMode::setTransformType ( ObjectMode::TRANSFORM_TYPE  type)
static

Sets the type of transformation applied to the node(s) selected by the manipulator.

Parameters
typeType of transformation to be set (see TRANSFORM_TYPE).

◆ snapToSurfaceNode()

static void UnigineEditor::ObjectMode::snapToSurfaceNode ( const Unigine::Ptr< Unigine::Node > &  node)
static

Snaps the specified node to surface.

Parameters
nodeNode to be snapped to surface.

◆ snapToSurfaceNodeList()

static void UnigineEditor::ObjectMode::snapToSurfaceNodeList ( const Unigine::Vector< Unigine::Ptr< Unigine::Node >> &  nodes)
static

Snaps the nodes from the specified list to surface.

Parameters
nodesList of nodes to be snapped to surface.