This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
FAQ
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
CIGI Client Plugin
Rendering-Related Classes
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::WorldSplineGraph Class

Header: #include <UnigineWorlds.h>
Inherits: Node
Read More

WorldSplineGraph Class

Members


static WorldSplineGraphPtr create ( )

Default constructor. Creates an empty world spline graph.

static WorldSplineGraphPtr create ( const char * name )

Constructor. Creates an empty world spline graph with a given name.

Arguments

  • const char * name - World spline graph name.

static Ptr<WorldSplineGraph> cast( const Ptr<Node> & node )

Casts a WorldSplineGraph out of the Node instance.

Arguments

  • const Ptr<Node> & node - Pointer to Node.

Return value

Pointer to WorldSplineGraph.

int getNumSplinePoints( )

Returns the total number of spline points in the world spline graph.

Return value

Number of spline points.

int getNumSplineSegments( )

Returns the total number of spline segments in the world spline graph.

Return value

Number of segments.

void setSplineGraphName( const char * name, int force_load = 0 )

Sets the name of the world spline graph.

Arguments

  • const char * name - World spline graph name.
  • int force_load - Force flag.
    • If 1 is specified, the world spline graph will immediately loaded from a file.
    • If 0 is specified, only the world spline graph name will be updated.

const char * getSplineGraphName( )

Returns the name of the world spline graph.

Return value

World spline graph name.

void loadSegmentNodes( int segment_index = -1 )

Loads source nodes assigned to the specified spline segment immediately.

Arguments

  • int segment_index - Segment index. If no segment index is specified, the method loads source nodes assigned to all segments.

void clear( )

Clears the world spline graph.

int isCurved( )

Returns a value indicating if the world spline graph is curved.

Return value

1 if the world spline graph is curved; otherwise, 0.

void makeCurved( )

Curves the world spline graph using its geodetic pivot. The spline file is saved upon completion of the curving operation.
Notice
The world spline graph must be a child of a Geodetic Pivot node.

void makeFlat( )

Flattens the world spline graph using its geodetic pivot. The spline file is saved upon completion of the flattening operation.
Notice
The world spline graph must be a child of a Geodetic Pivot node.

int load( const char * name )

Loads a spline graph from the specified XML-file.

Arguments

  • const char * name - Name of the XML-file to load the spline graph from.

Return value

1 if the spline graph was successfully loaded; otherwise, 0.

int save( const char * name )

Saves a spline graph to the specified XML-file.

Arguments

  • const char * name - Name of the XML-file to save the spline graph to.

Return value

1 if the spline graph was successfully saved; otherwise, 0.

static int type( )

Returns the type of the node.

Return value

WorldSplineGraph type identifier.

int getNumSegmentNodes( const Ptr<SplineSegment> & segment )

Returns the total number of nodes placed along the specified spline segment.

Arguments

  • const Ptr<SplineSegment> & segment - Spline segment for which the number of nodes is to be returned.

Return value

Total number of nodes placed along the specified spline segment.

void getSegmentNodeMesh( const Ptr<Mesh> & mesh, const Ptr<SplineSegment> & segment, int node_index, int bake_transform = 0 )

Gets a mesh used by a node with the specified index, placed along the specified spline segment, and puts it to the specified target Mesh instance.

Arguments

  • const Ptr<Mesh> & mesh - Target mesh instance to which the obtained mesh is to be put.
  • const Ptr<SplineSegment> & segment - Spline segment for which the mesh is to be returned.
  • int node_index - Number of the node instance placed along the spline segment.
  • int bake_transform - 1 to use baked mesh transformation, 0 - to use default (the mesh will be placed at the origin). The default value is 0.

Ptr<SplinePoint> createSplinePoint( const Math::Vec3 & position )

Creates a new spline point with the specified parameters and attaches it to the world spline graph.

Arguments

  • const Math::Vec3 & position - Position coordinates for the new splint point.

Return value

New spline point.

void removeSplinePoint( const Ptr<SplinePoint> & point, int merge = 0 )

Removes the specified spline point from the world spline graph. You can set the merge flag to merge spline segments sharing this point as their start and end points.
Notice
Segment merging is available only when the point to be removed is shared by two segments, otherwise the merge flag is ignored and all segments sharing this point are also removed.

Arguments

  • const Ptr<SplinePoint> & point - Spline point to be removed.
  • int merge - 1 to merge spline segments sharing this point as their start and end points, 0 to remove all segments sharing this point. The default value is 0.

void getSplinePoints( Vector< Ptr<SplinePoint> > & points )

Returns the list of all points of the world spline graph and puts them to the specified vector of SplinePoint elements.

Arguments

  • Vector< Ptr<SplinePoint> > & points - Vector to store the list of all points of the world spline graph.

Ptr<SplineSegment> createSplineSegment( const Ptr<SplinePoint> & start_point, const Math::vec3 & start_tangent, const Math::vec3 & start_up, const Ptr<SplinePoint> & end_point, const Math::vec3 & end_tangent, const Math::vec3 & end_up )

Creates a new spline segment with the specified parameters and attaches it to the world spline graph.

Arguments

  • const Ptr<SplinePoint> & start_point - Start point of the spline segment.
  • const Math::vec3 & start_tangent - Tangent coordinates for the start point of the spline segment.
  • const Math::vec3 & start_up - Coordinates of the "up" vector for the start point of the spline segment.
  • const Ptr<SplinePoint> & end_point - End point of the segment.
  • const Math::vec3 & end_tangent - Tangent coordinates for the end point of the spline segment.
  • const Math::vec3 & end_up - Coordinates of the "up" vector for the end point of the spline segment.

Return value

New spline segment connecting two specified points.

void removeSplineSegment( const Ptr<SplineSegment> & segment, int with_points = 0 )

Removes the specified spline segment from the world spline graph. You can set the with_points flag to remove the segment together with its start and end points.

Arguments

  • const Ptr<SplineSegment> & segment - Spline segment to be removed.
  • int with_points - 1 to remove the segment with its start and end points, 0 to keep points. The default value is 0.

void getSplineSegments( Vector< Ptr<SplineSegment> > & segments )

Returns the list of all segments of the world spline graph and puts them to the specified vector of SplineSegment elements.

Arguments

  • Vector< Ptr<SplineSegment> > & segments - Vector to store the list of all segments of the world spline graph.

void rebuild( )

Rebuilds the world spline graph. This method is to be called after making any changes to spline segments (mode, etc.), point positions, tangents, or "up" vectors, as well as after changing source node assignments and/or other parameters (UV tiling, gap, etc.)

void * addPointAddedCallback( Unigine::CallbackBase2< Ptr<Body>, int > * func )

Adds a callback function to be called when a point is added to the world spline graph. The signature of the Point Added callback function must be as follows:
Source code (C++)
void point_added_callback_function_name(WorldSplineGraphPtr graph, SplinePointPtr point);

You can set a callback function as follows:

Source code (C++)
addPointAddedCallback(MakeCallback(point_added_callback_function_name));

Arguments

  • Unigine::CallbackBase2< Ptr<Body>, int > * func - Callback pointer.

Return value

ID of the last added Point Added callback, if the callback was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary.

bool removePointAddedCallback( void * id )

Removes the specified callback from the list of Point Added callbacks.

Arguments

  • void * id - Point Added callback ID obtained when adding it.

Return value

True if the Point Added callback with the given ID was removed successfully; otherwise false.

void clearPointAddedCallbacks( )

Clears all added Point Added callbacks.

void * addPointChangedCallback( Unigine::CallbackBase2< Ptr<Body>, int > * func )

Adds a callback function to be called when a point of the world spline graph is modified. The signature of the Point Changed callback function must be as follows:
Source code (C++)
void point_changed_callback_function_name(WorldSplineGraphPtr graph, SplinePointPtr point);

You can set a callback function as follows:

Source code (C++)
addPointChangedCallback(MakeCallback(point_changed_callback_function_name));

Arguments

  • Unigine::CallbackBase2< Ptr<Body>, int > * func - Callback pointer.

Return value

ID of the last added Point Changed callback, if the callback was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary.

bool removePointChangedCallback( void * id )

Removes the specified callback from the list of Point Changed callbacks.

Arguments

  • void * id - Point Changed callback ID obtained when adding it.

Return value

True if the Point Changed callback with the given ID was removed successfully; otherwise false.

void clearPointChangedCallbacks( )

Clears all added Point Changed callbacks.

void * addPointRemovedCallback( Unigine::CallbackBase2< Ptr<Body>, int > * func )

Adds a callback function to be called when a point of the world spline graph is removed. The signature of the Point Removed callback function must be as follows:
Source code (C++)
void point_removed_callback_function_name(WorldSplineGraphPtr graph, SplinePointPtr point);

You can set a callback function as follows:

Source code (C++)
addPointRemovedCallback(MakeCallback(point_removed_callback_function_name));

Arguments

  • Unigine::CallbackBase2< Ptr<Body>, int > * func - Callback pointer.

Return value

ID of the last added Point Removed callback, if the callback was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary.

bool removePointRemovedCallback( void * id )

Removes the specified callback from the list of Point Removed callbacks.

Arguments

  • void * id - Point Removed callback ID obtained when adding it.

Return value

True if the Point Removed callback with the given ID was removed successfully; otherwise false.

void clearPointRemovedCallbacks( )

Clears all added Point Removed callbacks.

void * addSegmentAddedCallback( Unigine::CallbackBase2< Ptr<Body>, int > * func )

Adds a callback function to be called when a segment is added to the world spline graph. The signature of the Segment Added callback function must be as follows:
Source code (C++)
void segment_added_callback_function_name(WorldSplineGraphPtr graph, SplineSegmentPtr segment);

You can set a callback function as follows:

Source code (C++)
addSegmentAddedCallback(MakeCallback(segment_added_callback_function_name));

Arguments

  • Unigine::CallbackBase2< Ptr<Body>, int > * func - Callback pointer.

Return value

ID of the last added Segment Added callback, if the callback was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary.

bool removeSegmentAddedCallback( void * id )

Removes the specified callback from the list of Segment Added callbacks.

Arguments

  • void * id - Segment Added callback ID obtained when adding it.

Return value

True if the Segment Added callback with the given ID was removed successfully; otherwise false.

void clearSegmentAddedCallbacks( )

Clears all added Segment Added callbacks.

void * addSegmentChangedCallback( Unigine::CallbackBase2< Ptr<Body>, int > * func )

Adds a callback function to be called when a segment of the world spline graph is modified. The signature of the Segment Changed callback function must be as follows:
Source code (C++)
void segment_changed_callback_function_name(WorldSplineGraphPtr graph, SplineSegmentPtr segment);

You can set a callback function as follows:

Source code (C++)
addSegmentChangedCallback(MakeCallback(segment_changed_callback_function_name));

Arguments

  • Unigine::CallbackBase2< Ptr<Body>, int > * func - Callback pointer.

Return value

ID of the last added Segment Changed callback, if the callback was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary.

bool removeSegmentChangedCallback( void * id )

Removes the specified callback from the list of Segment Changed callbacks.

Arguments

  • void * id - Segment Changed callback ID obtained when adding it.

Return value

True if the Segment Changed callback with the given ID was removed successfully; otherwise false.

void clearSegmentChangedCallbacks( )

Clears all added Segment Changed callbacks.

void * addSegmentRemovedCallback( Unigine::CallbackBase2< Ptr<Body>, int > * func )

Adds a callback function to be called when a segment of the world spline graph is removed. The signature of the Segment Removed callback function must be as follows:
Source code (C++)
void segment_removed_callback_function_name(WorldSplineGraphPtr graph, SplineSegmentPtr segment);

You can set a callback function as follows:

Source code (C++)
addSegmentRemovedCallback(MakeCallback(segment_removed_callback_function_name));

Arguments

  • Unigine::CallbackBase2< Ptr<Body>, int > * func - Callback pointer.

Return value

ID of the last added Segment Removed callback, if the callback was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary.

bool removeSegmentRemovedCallback( void * id )

Removes the specified callback from the list of Segment Removed callbacks.

Arguments

  • void * id - Segment Removed callback ID obtained when adding it.

Return value

True if the Segment Removed callback with the given ID was removed successfully; otherwise false.

void clearSegmentRemovedCallbacks( )

Clears all added Segment Removed callbacks.
Last update: 2018-12-27
Build: ()