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::WorldExternBase Class

Unigine Base WorldExtern class.

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

Unigine::WorldExternBase Class

Members


ConstructorFunc Type Definition

Description

Full declaration:
typedef WorldExternBase*(* Unigine::WorldExternBase::ConstructorFunc)(void *world)

WorldExternBase constructor functor.

Arguments

world - WorldExtern pointer.

Return value

WorldExternBase class.

WorldExternBase ()

WorldExternBase constructor.

WorldExternBase (void * world)

WorldExternBase constructor.

Arguments

  • void * world - Pointer to an external world.

virtual ~WorldExternBase ()

Virtual destructor.

void grab () const

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

void release () const

Sets the owner flag to 0 for the world pointer. The world 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< WorldExtern > getWorldExtern () const

Returns the WorldExtern smart pointer.

Return value

WorldExtern smart pointer.

virtual void updateEnabled ()

Updates enabled.

virtual void updatePosition ()

Updates a position of the external world.

virtual void updateTransform ()

Updates transformation matrix of the external world.

virtual void update (float ifps)

Update function. It is called when the node is visible.

Arguments

  • float ifps - Inverse FPS value.

virtual void flush (float ifps)

Flush function. It is called when the node is visible.

Arguments

  • float ifps - Inverse FPS value.

virtual const BoundBox & getBoundBox ()

Returns the bounding box of the external world.

Return value

Bounding box.

virtual const BoundSphere & getBoundSphere ()

Returns the bounding sphere of the external world.

Return value

Bounding sphere.

virtual const UNIGINE_BOUND_BOX & getWorldBoundBox ()

Returns the world bounding box of the external world.

Return value

World bounding box.

virtual const UNIGINE_BOUND_SPHERE & getWorldBoundSphere ()

Returns the world bounding sphere of the external world.

Return value

World bounding sphere.

virtual void renderHandler ()

Renders the handler for the external world.

virtual void renderVisualizer ()

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

virtual void copy (WorldExternBase * world)

Copies a world state into the other world.

Arguments

  • WorldExternBase * world - Destination WorldExternBase pointer.

virtual void swap (WorldExternBase * world)

Swaps states of the external world.

Arguments

  • WorldExternBase * world - WorldExternBase pointer.

virtual int loadWorld (const XmlPtr & xml)

Loads a world state from the Xml.

Arguments

  • const XmlPtr & xml - Xml smart pointer.

Return value

Returns 1 if the world state was successfully loaded; otherwise, 0.

virtual int saveWorld (const XmlPtr & xml)

Saves a world state into the Xml.

Arguments

  • const XmlPtr & xml - Xml smart pointer.

Return value

Returns 1 if the world state was successfully saved; otherwise, 0.

virtual int saveState (const StreamPtr & stream)

Saves a world state into the stream.

Arguments

  • const StreamPtr & stream - Stream smart pointer.

Return value

Returns 1 if the world state was successfully saved; otherwise, 0.

virtual int restoreState (const StreamPtr & stream)

Restores a world state from the stream.

Arguments

  • const StreamPtr & stream - Stream smart pointer.

Return value

Returns 1 if the world state was successfully restored; otherwise, 0.

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, WorldExternBase * world)

Saves a world pointer into the stream.

Arguments

  • const StreamPtr & stream - Stream smart pointer.
  • WorldExternBase * world - World pointer.

static WorldExternBase * restorePointer (const StreamPtr & stream)

Restores a world pointer from the stream.

Arguments

  • const StreamPtr & stream - Stream smart pointer.

Return value

World pointer.
Last update: 2017-07-03