GwNavWorld - stingray.GwNavWorld object reference - Stingray Lua API Reference

stingray.GwNavWorld object reference

Description

Represents a Navigation world.

Functions

Parameters

database_or_world :

any(stingray.GwNavWorld, stingray.GwNavDatabase)

The GwNavDatabase the navdata will be added to. If a GwNavWorld, the default GwNavDatabase will be used.

The any(...) notation indicates that this item may be an instance of any of the types shown in the parentheses.

navdata :

string

The resource name of the NavData to add without database suffix.

Returns

stingray.GwNavData

The loaded navdata if successfully loaded, nil otherwise.

Parameters

self :

stingray.GwNavWorld

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

smartobject_id :

number

The smartobject ID to allow to be traversed

Returns
This function does not return any values.
Parameters

transform :

stingray.Matrix4x4?

Specifies the transform for the new GwNavWorld in 3D space. Optional. If omitted, the GwNavWorld uses the identity matrix.

The ? notation indicates that this type is optional: there may be zero or one instances of it.

database_count :

integer?

Optional. Number of database that will be used.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Returns

stingray.GwNavWorld

The new GwNavWorld.

Parameters

self :

stingray.GwNavWorld

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

database_id :

integer

The id of the database

Returns

stingray.GwNavDatabase

A pointer to the Kaim::Database if it exists.

Parameters

self :

stingray.GwNavWorld

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

number

The number of Database the GwNavWorld as created with.

Parameters

self :

stingray.GwNavWorld

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns
This function does not return any values.
Parameters

self :

stingray.GwNavWorld

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns
This function does not return any values.
Parameters

self :

stingray.GwNavWorld

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

smartobject_id :

number

The smartobjectID to forbid to be traversed

Returns
This function does not return any values.
Parameters

self :

stingray.GwNavWorld

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns
This function does not return any values.

important - This must be called if you intend to call kick_async_update()/join_async_update().

Parameters

self :

stingray.GwNavWorld

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns

boolean

true if stingray.GwNavWorld.enable_crowd_dispersion was called

Parameters

self :

stingray.GwNavWorld

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.
Returns
This function does not return any values.

important - A call to this function should map 1-to-1 to a call to kick_async_update().

Parameters

self :

stingray.GwNavWorld

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

delta_time :

number

The time step that the GwNavWorld should use when updating, in seconds.

Returns
This function does not return any values.

important - No Navigation related functions must be called before calling join_update() (see below), otherwise crashes or other undefined behavior will occur.

Parameters

self :

stingray.GwNavWorld

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

nav_graph :

stingray.GwNavGraph

The GwNavGraph to register for Crowd Dispersion.

Returns
This function does not return any values.
Parameters

self :

stingray.GwNavWorld

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

tag_volume :

stingray.GwNavTagVolume

The GwNavTagVolume to register for crowd dispersion.

Returns
This function does not return any values.
Parameters

navdata :

stingray.GwNavData

The filename of the NavData resource to add.

Returns
This function does not return any values.
Parameters

self :

stingray.GwNavWorld

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

budget :

number

The budget in seconds, for the dynamic NavMesh.

Returns
This function does not return any values.

The world will not exceed the specified budget when processing the dynamic navmesh.

Parameters

self :

stingray.GwNavWorld

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

budget :

number

The budget in seconds, for pathfinding.

Returns
This function does not return any values.

The world will not exceed the specified budget when processing pathfinding requests.

Parameters

self :

stingray.GwNavWorld

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

smartobject_id :

number

The smartobjectID to set.

cost_multiplier :

number

The associated cost multiplier of this smartobject.

Returns
This function does not return any values.
Parameters

self :

stingray.GwNavWorld

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

smartobject_id :

number

The smartobjectID to unset.

Returns
This function does not return any values.

If the smartobject_id is encountered but no cost was set, it will be traversed.

Parameters

self :

stingray.GwNavWorld

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

delta_time :

number

The time step that the GwNavWorld should use when updating, in seconds.

Returns
This function does not return any values.

Development only

The elements in this group are only available in development builds.

Do not use them in your final builds.

Parameters

database_or_world :

any(stingray.GwNavWorld, stingray.GwNavDatabase)

The GwNavDatabase to use. If a GwNavWorld, the default GwNavDatabase will be used.

The any(...) notation indicates that this item may be an instance of any of the types shown in the parentheses.
Returns
This function does not return any values.
Parameters

database_or_world :

any(stingray.GwNavWorld, stingray.GwNavDatabase)

The GwNavDatabase to use. If a GwNavWorld, the default GwNavDatabase will be used.

The any(...) notation indicates that this item may be an instance of any of the types shown in the parentheses.
Returns

integer

The number of tiles in the database.

Parameters

database_or_world :

any(stingray.GwNavWorld, stingray.GwNavDatabase)

The GwNavDatabase to use. If a GwNavWorld, the default GwNavDatabase will be used.

The any(...) notation indicates that this item may be an instance of any of the types shown in the parentheses.

tile_index :

integer

The index of the tile to get the triangle count for.

Returns

integer

The number of triangles in the tile.

Parameters

database_or_world :

any(stingray.GwNavWorld, stingray.GwNavDatabase)

The GwNavDatabase to use. If a GwNavWorld, the default GwNavDatabase will be used.

The any(...) notation indicates that this item may be an instance of any of the types shown in the parentheses.

tile_index :

integer

The index of the tile in the database.

triangle_index :

integer

The index of the triangle in the tile.

Returns

stingray.Vector3?

Vertex of the triangle if found, nil otherwise.

The ? notation indicates that this type is optional: there may be zero or one instances of it.

stingray.Vector3?

Vertex of the triangle if found, nil otherwise.

The ? notation indicates that this type is optional: there may be zero or one instances of it.

stingray.Vector3?

Vertex of the triangle if found, nil otherwise.

The ? notation indicates that this type is optional: there may be zero or one instances of it.

stingray.Quaternion?

The Color of the triangle if found, nil otherwise.

The ? notation indicates that this type is optional: there may be zero or one instances of it.
Parameters

self :

stingray.GwNavWorld

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

server_port :

number

The port that the GwNavWorld should use when creating it's visual debug server.

Returns
This function does not return any values.
Parameters

self :

stingray.GwNavWorld

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

position :

stingray.Vector3

The wanted position of the camera.

look_at :

stingray.Vector3

The position the camera should point at.

up :

stingray.Vector3

The "up" axis of the camera.

Returns
This function does not return any values.

In this way we can see the POV of a bot or any other interesting POV.

Parameters

self :

stingray.GwNavWorld

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

display_list_name :

string

Name of the display list.

group_name :

string

Group the display list belongs to.

start :

stingray.Vector3

Start position of the line.

end :

stingray.Vector3

End position of the line.

color :

stingray.Quaternion

Line color.

Returns
This function does not return any values.
Parameters

self :

stingray.GwNavWorld

Specifies the object instance that this function will act on.

You must always provide this self parameter when you call this function. You must use the dot . calling syntax, not the object-oriented colon : calling syntax.For more information, see this Stingray help topic, or this page in the Lua documentation.

display_list_name :

string

Name of the display list.

group_name :

string

Group the display list belongs to.

text :

string

Text to draw.

position :

stingray.Vector3

Position of the text.

color :

stingray.Quaternion

Text color.

Returns
This function does not return any values.