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

ObjectExternBase Class

Unigine Base ObjectExtern class.

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

ObjectExternBase Class

Members


void updateTransform ()

Updates transformation.

int findSurface (const char * name)

Returns the number of the object surface by its name.

Arguments

  • const char * name - Surface name.

Return value

Surface number.

int getRandomPoint (Math::vec3 & ret_point, Math::vec3 & ret_normal, Math::vec3 & ret_velocity, int surface)

Returns a random point from a surface.

Arguments

  • Math::vec3 & ret_point - Random point coordinates.
  • Math::vec3 & ret_normal - Random normal vector.
  • Math::vec3 & ret_velocity - Random velocity vector.
  • int surface - Surface number.

Return value

Returns 1 if the random point is valid.

int getOrder (const Math::Vec3 & camera, int surface)

Returns the rendering order with respect to the camera position.

Arguments

  • const Math::Vec3 & camera - World camera position.
  • int surface - Surface number.

Return value

Surface rendering order.

int restoreState (const Ptr<Stream> & stream)

Restores an object state from the stream.

Arguments

  • const Ptr<Stream> & stream - Stream smart pointer.

Return value

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

int saveState (const Ptr<Stream> & stream)

Saves an object state into the stream.

Arguments

  • const Ptr<Stream> & stream - Stream smart pointer.

Return value

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

void updatePosition ()

Updates a position.

Ptr<Object> getObject ()

Returns the Object smart pointer.

Return value

Object smart pointer.

int isOwner ()

Returns the "owner" flag.

Return value

The "owner" flag.

void grab ()

Grabs an object. The object should not be handled by the class after this function is called.

Ptr<Node> getNode ()

Returns the Node smart pointer.

Return value

Node smart pointer.

void update (float ifps)

Update function.

Arguments

  • float ifps - Inverse FPS value.

int saveWorld (const Ptr<Xml> & xml)

Saves an object state into the Xml.

Arguments

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

Return value

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

void updateSurfaces ()

Updates all of the object surfaces.

void release ()

Releases an object. The object should be handled by the class after this function is called.

void updateEnabled ()

Updates enabled.

void create (int surface)

Renders a create function.

Arguments

  • int surface - Surface number.

void resizeSurfaces ()

Resizes all of the object surfaces.

void renderHandler ()

Renders the handler.

void renderVisualizer ()

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

int hasRender ()

Returns a value indicating that the object has a render function.

Return value

Returns 1 if the object has a render function.

int getSequence (const Math::Vec3 & camera, int surface)

Returns the rendering sequence with respect to the camera position.

Arguments

  • const Math::Vec3 & camera - World camera position.
  • int surface - Surface number.

Return value

Surface rendering sequence.

float getOpacityDistance (const Math::Vec3 & camera, int surface)

Returns the opacity rendering distance.

Arguments

  • const Math::Vec3 & camera - World camera position.
  • int surface - Surface number.

Return value

Surface rendering distance.

void renderQuery ()

Renders a query function.

int hasCreate ()

Returns a value indicating that the object has a create function.

Return value

Returns 1 if the object has a create function.

int hasLods ()

Returns a value indicating if the object has LODs.

Return value

Returns 1 if the object has surface LODs.

int getNumTriangles (int surface)

Returns the number of triangles.

Arguments

  • int surface - Surface number.

Return value

Returns the number of triangles.

int getCollision (const Math::vec3 & p0, const Math::vec3 & p1, Vector< int > & surfaces)

Spatial collision with the bounding box.

Arguments

  • const Math::vec3 & p0 - Coordinates of the start point of the line.
  • const Math::vec3 & p1 - Coordinates of the end point of the line.
  • Vector< int > & surfaces - Return array with surface numbers.

Return value

Returns 1 if the array of surfaces is not empty.

void updateEnabled (int surface)

Updates enabled.

Arguments

  • int surface - Surface number.

int loadWorld (const Ptr<Xml> & xml)

Loads an object state from the Xml.

Arguments

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

Return value

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

int getResource (int surface)

Returns the unique render resource identifier.

Arguments

  • int surface - Surface number.

Return value

Surface resource identifier.

Ptr<ObjectExtern> getObjectExtern ()

Returns the ObjectExtern smart pointer.

Return value

ObjectExtern smart pointer.

void render (int pass, int surface)

Renders a render function.

Arguments

  • int pass - Rendering pass.
  • int surface - Surface number.

float getTransparentDistance (const Math::Vec3 & camera, int surface)

Returns the transparent rendering distance.

Arguments

  • const Math::Vec3 & camera - World camera position.
  • int surface - Surface number.

Return value

Surface rendering distance.

void renderShadow (int pass, int surface)

Renders render function.

Arguments

  • int pass - Rendering pass.
  • int surface - Surface number.

int getCollision (const BoundBox & bb, Vector< int > & surfaces)

Spatial collision with the bounding box.

Arguments

  • const BoundBox & bb - Bounding box.
  • Vector< int > & surfaces - Return array with surface numbers.

Return value

Returns 1 if the array of surfaces is not empty.

void flush (float ifps)

Flush function.

Arguments

  • float ifps - Inverse FPS value.

int hasQuery ()

Returns a value indicating that the object has a query function.

Return value

Returns 1 if the object has a query function.

int hasShadow ()

Returns a value indicating that the object has a shadow function.

Return value

Returns 1 if the object has a shadow function.

int getIntersection (const Math::vec3 & p0, const Math::vec3 & p1, Math::vec3 * ret_point, Math::vec3 * ret_normal, Math::vec4 * ret_texcoord, int * ret_index, int surface)

Returns a value indicating that the line intersects the object surface.

Arguments

  • const Math::vec3 & p0 - Coordinates of the start point of the line.
  • const Math::vec3 & p1 - Coordinates of the end point of the line.
  • Math::vec3 * ret_point - Intersection point coordinates.
  • Math::vec3 * ret_normal - Intersection normal vector.
  • Math::vec4 * ret_texcoord - Intersection texture coordinates.
  • int * ret_index - Intersection index number.
  • int surface - Surface number.

Return value

Returns 1 if the intersection occurs.

int getClassID ()

Returns a unique class ID.

Return value

Unique class ID.

int getNumSurfaces ()

Returns the number of object surfaces.

Return value

The number of object surfaces.

const char * getSurfaceName (int surface)

Returns the object surface name.

Arguments

  • int surface - Surface number.

Return value

Surface name.
Last update: 2017-07-03