Difference between revisions of "ISKernel:navpath (Data Type)"

From Lavish Software Wiki
Jump to navigation Jump to search
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
'''navpath is deprecated and is not supported. There may be bugs in it. Please use [[LavishNav]] instead'''
 +
 
== Description ==
 
== Description ==
 
+
This data type gives access to '''Navigation Path''' information. The methods control '''Navigation Path''' information.
 
== Members ==
 
== Members ==
*[[DataType:point3f|point3f]] '''Point['''#''']''': Retrieves a point on the path, starting with 1
+
*[[DataType:point3f|point3f]] '''Point['''#''']''': Retrieves a point on the path. (Valid # is 1-Points)
*[[DataType:string|string]] '''PointName['''#''']''': Retrieves the original name of a point on the path, starting with 1
+
*[[DataType:string|string]] '''PointName['''#''']''': Retrieves the original name of a point on the path. (Valid # is 1-Points)
 
*[[DataType:int|int]] '''Points''': The total number of points on this path
 
*[[DataType:int|int]] '''Points''': The total number of points on this path
 
*[[DataType:int|int]] '''NearestPoint['''x''']''': Retrieves the number of the nearest point on the path to location (x,0,0)
 
*[[DataType:int|int]] '''NearestPoint['''x''']''': Retrieves the number of the nearest point on the path to location (x,0,0)
Line 16: Line 18:
  
 
== Returns ==
 
== Returns ==
 +
''NULL''
 +
== Examples ==
 +
===Declare a NavPath variable===
 +
*declare PathHome navpath
 +
:This command will declare a '''navpath''' variable with the name "PathHome"
 +
===Find shortest path from point a to point b===
 +
*NavPath:GetPath[earth,detroit,cincinatti]
 +
:This command will get the shortest path from "detroit" to "cincinatti" in the world "earth"
 +
===Find the nearest point to a given location===
 +
*echo Nearest Point: ${NavPath.NearestPoint[123,432,-222]}
 +
:This command will find the nearest point to the given X,Y,Z and returns the '''Point''' index #
 +
===Find total number of points in a path===
 +
*echo Total Points: ${PathHome.Points}
 +
;Output
 +
Total Points: 47
 +
===List the name of all points===
 +
;Sample code
 +
declare x int 1
 +
  do
 +
  {
 +
  echo Point ${x}: ${PathHome.PointName[x]}
 +
  }
 +
  while (${x:Inc}<=${PathHome.Points})
  
== Examples ==
+
===Reverse a path===
 +
*PathHome:Reverse
 +
:This command will change a path that goes from point A to B to C to now be from C to B to A
  
 
== See Also ==
 
== See Also ==
* [[LavishScript:Data Types|LavishScript Data Types]]
+
*[[ISSession:Navigation_System|Navigation_System]]
* [[IS:Session#Data_Types|Inner Space Session Data Types]]
+
*[[ISSession:NavPath (Command)|NavPath (Command)]]
 +
*[[ISSession:Navigation (Command)|Navigation (Command)]]
 +
*[[ISSession:NavPoint (Command)|NavPoint (Command)]]
 +
*[[ISSession:navpoint (Data Type)|navpoint (Data Type)]]
 +
*[[ISSession:navigation (Data Type)|navigation (Data Type)]]
 +
*[[ISSession:navworld (Data Type)|navworld (Data Type)]]
 +
*[[ISSession:Navigation (Top-Level Object)|Navigation (Top-Level Object)]]
 +
*[[ISSession:NavPath (Top-Level Object)|NavPath (Top-Level Object)]]
 +
*[[LavishScript:Data Types|Data Types]]
 +
*[[IS:Kernel#Data_Types|Kernel Data Types]]
  
 
{{DT-Stub}}
 
{{DT-Stub}}
 
[[Category:Inner Space]]
 
[[Category:Inner Space]]
[[Category:Inner Space Session]]
+
[[Category:Inner Space Kernel]]
[[Category:Inner Space Session Data Types]]
+
[[Category:Inner Space Kernel Data Types]]

Latest revision as of 13:52, 10 July 2009

navpath is deprecated and is not supported. There may be bugs in it. Please use LavishNav instead

Description

This data type gives access to Navigation Path information. The methods control Navigation Path information.

Members

  • point3f Point[#]: Retrieves a point on the path. (Valid # is 1-Points)
  • string PointName[#]: Retrieves the original name of a point on the path. (Valid # is 1-Points)
  • int Points: The total number of points on this path
  • int NearestPoint[x]: Retrieves the number of the nearest point on the path to location (x,0,0)
  • int NearestPoint[x,y]: Retrieves the number of the nearest point on the path to location (x,y,0)
  • int NearestPoint[x,y,z]: Retrieves the number of the nearest point on the path to location (x,y,z)

Methods

  • Clear: Resets the path so it contains no points
  • GetPath[world,point a,point b]: Gets the shortest path from point A to point B (clearing is not required, it is done automatically)
  • GetPath[world,point a,point b,additional points ...]: Gets the shortest path from point A to point B to point C to point D ad infinitum (clearing is not required, it is done automatically)
  • Reverse: Reverses the path

Returns

NULL

Examples

Declare a NavPath variable

  • declare PathHome navpath
This command will declare a navpath variable with the name "PathHome"

Find shortest path from point a to point b

  • NavPath:GetPath[earth,detroit,cincinatti]
This command will get the shortest path from "detroit" to "cincinatti" in the world "earth"

Find the nearest point to a given location

  • echo Nearest Point: ${NavPath.NearestPoint[123,432,-222]}
This command will find the nearest point to the given X,Y,Z and returns the Point index #

Find total number of points in a path

  • echo Total Points: ${PathHome.Points}
Output
Total Points: 47

List the name of all points

Sample code
declare x int 1
 do
 {
  echo Point ${x}: ${PathHome.PointName[x]}
 }
 while (${x:Inc}<=${PathHome.Points})

Reverse a path

  • PathHome:Reverse
This command will change a path that goes from point A to B to C to now be from C to B to A

See Also