This page has been translated automatically.
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
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::NodeExternBase Class

Unigine Base NodeExtern class.

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

Unigine::NodeExternBase Class

Members


ConstructorFunc Type Definition

Description

Full declaration:
typedef NodeExternBase*(* Unigine::NodeExternBase::ConstructorFunc)(void *node)

NodeExternBase constructor functor.

Arguments

node - NodeExtern pointer.

Return value

NodeExternBase class.

NodeExternBase ()

NodeExternBase constructor.

NodeExternBase (void * node)

NodeExternBase constructor.

Arguments

  • void * node - Pointer to an external node.

virtual ~NodeExternBase ()

Virtual destructor.

void grab () const

Sets the owner flag to 1 for the node pointer. The node should not be handled by the class after this function is called.

void release () const

Sets the owner flag to 0 for the node pointer. The node should be handled by the class after this function is called.

int isOwner () const

Returns the owner flag of the pointer. If the pointer is owner, on its deletion the object also will be deleted.

Return value

The owner flag.

virtual int getClassID () =0

Returns a unique class ID.

Return value

Unique class ID.

Ptr< Node > getNode () const

Returns the Node smart pointer.

Return value

Node smart pointer.

Ptr< NodeExtern > getNodeExtern () const

Returns the NodeExtern smart pointer.

Return value

NodeExtern smart pointer.

virtual void updateEnabled ()

Updates enabled.

virtual void updatePosition ()

Updates a position of the external node.

virtual void updateTransform ()

Updates transformation matrix of the external node.

virtual const BoundBox & getBoundBox ()

Returns the bounding box of the external node.

Return value

Bounding box.

virtual const BoundSphere & getBoundSphere ()

Returns the bounding sphere of the external node.

Return value

Bounding sphere.

virtual const UNIGINE_BOUND_BOX & getWorldBoundBox ()

Returns the world bounding box of the external node.

Return value

World bounding box.

virtual const UNIGINE_BOUND_SPHERE & getWorldBoundSphere ()

Returns the world bounding sphere of the external node.

Return value

World bounding sphere.

virtual void renderHandler ()

Renders the handler for the external node.

virtual void renderVisualizer ()

Renders the visualizer.
Notice
You should enable the engine visualizer by the show_visualizer 1 console command.

virtual void copy (NodeExternBase * node)

Copies a node state into the other node.

Arguments

  • NodeExternBase * node - Destination NodeExternBase pointer.

virtual void swap (NodeExternBase * node)

Swaps states of the external node.

Arguments

  • NodeExternBase * node - NodeExternBase pointer.

virtual int loadWorld (const XmlPtr & xml)

Loads a node state from the Xml.

Arguments

  • const XmlPtr & xml - Xml smart pointer.

Return value

Returns 1 if the node state was successfully loaded; otherwise, 0 is returned.

virtual int saveWorld (const XmlPtr & xml)

Saves a node state into the Xml.

Arguments

  • const XmlPtr & xml - Xml smart pointer.

Return value

Returns 1 if the node state was successfully saved; otherwise, 0 is returned.

virtual int saveState (const StreamPtr & stream)

Saves a node state into the stream.

Arguments

  • const StreamPtr & stream - Stream smart pointer.

Return value

Returns 1 if the node state was successfully saved; otherwise, 0 is returned.

virtual int restoreState (const StreamPtr & stream)

Restores a node state from the stream.

Arguments

  • const StreamPtr & stream - Stream smart pointer.

Return value

Returns 1 if the node state was successfully restored; otherwise, 0 is returned.

static void addClassID (int class_id, ConstructorFunc func)

Registers a constructor for a specified class ID.

Arguments

  • int class_id - Unique class ID.
  • ConstructorFunc func - Constructor functor.

static void addClassID (int class_id)

Registers a constructor for a specified class type.

Arguments

  • int class_id - Unique class ID.

static void savePointer (const StreamPtr & stream, NodeExternBase * node)

Saves a node pointer into the stream.

Arguments

  • const StreamPtr & stream - Stream smart pointer.
  • NodeExternBase * node - Node pointer.

static NodeExternBase * restorePointer (const StreamPtr & stream)

Restores a node pointer from the stream.

Arguments

  • const StreamPtr & stream - Stream smart pointer.

Return value

Node pointer.
Last update: 2017-07-03
Build: ()