Skyline Lua API  Version 1.0
Lua Script Reference for Skyline Game Engine.
path Class Reference

#include <LUA_API_Path.h>

Public Member Functions

float3 getNodePosition (string pathName, int nodeIndex)
 Get the position of the node index you have passed through. You can get the position of every node between the main nodes and the main nodes themselves The Main nodes are the nodes that you manually add in the scene to draw the line. The nodes inbetween allow the spline to have a curve. The more nodes you have set between the main nodes, the more curve accuracy there will be. More...
 
float getNodeYaw (string pathName, int nodeIndex)
 Get the yaw rotation of the node index you have passed through. This is a precalculated yaw angle created by the spline path editor. More...
 
void setNodePosition (string pathName, int nodeIndex, float posX, float posY, float posZ)
 Set the position of the node index you have passed through. This only works for the main nodes that you manually add using the Spline path editor. More...
 
int getNumNodes (string pathName)
 Gets how many nodes the path specified has. This also adds all the nodes in between the main nodes. More...
 
int doesPathExist (string pathName)
 Check whether the path specified exists or not. This is a boolean function as it returns true or false. More...
 
path createPath (“pathName”)
 Create a Path. More...
 
path removePath (“pathName”)
 remove a Path More...
 
path insertNode (“pathName”, id, x, y, z)
 Insert a node into the path. More...
 
path deleteNode (“pathName”, id)
 Remove a node into the path. More...
 
path insertNode (“pathName”, id, x, y, z)
 Insert a node into the path. More...
 

Detailed Description

This area covers path functions. Set or get various path properties.
Use as path.function()
Path functions require the use of the path name in the function.

For more information on how these functions can be used please visit the User Manual - https://home.aurasoft-skyline.co.uk

Here is an example of the path class beng used.

obj =0;
pathName = "MyPath";

function onInit(objID)
    -- check if path exists
    pathExists = path.doesPathExist(pathName);
    sky.lprint("pathExists: "..pathExists);


    -- if path does not exist then return;
    if(pathExists == 0)then return; end

    -- get the number of nodes this path has.
    numNodes = path.getNumNodes(pathName);
    sky.lprint("numNodes: "..numNodes);


    -- print out the node positions for this path.

    for nodeIndex = 0, numNodes-1 do
        x,y,z = path.getNodePosition(pathName, nodeIndex); -- this will return the 6 node. 
        sky.lprint("X: "..x.." :Y: "..y.." :Z: "..z);
    end
end

Member Function Documentation

path path::createPath ( “pathName”  )

Create a Path.

Parameters
pathName: The name of the path set up in the spline path editor.

Here is a Small Example of how to use this function:

function onInit(objID)
    coming soon
end
path path::deleteNode ( “pathName”  ,
id   
)

Remove a node into the path.

Parameters
pathName: The name of the path set up in the spline path editor.
ID:

Here is a Small Example of how to use this function:

function onInit(objID)
    coming soon
end
int path::doesPathExist ( string  pathName)

Check whether the path specified exists or not. This is a boolean function as it returns true or false.

1 = True 0 = False

Parameters
pathName: The name of the path set up in the spline path editor.

Here is a Small Example of how to use this function:

function onInit(objID)
    check = path.doesPathExist("MyPath");
    sky.lprint("check: "..check);
end
float3 path::getNodePosition ( string  pathName,
int  nodeIndex 
)

Get the position of the node index you have passed through. You can get the position of every node between the main nodes and the main nodes themselves The Main nodes are the nodes that you manually add in the scene to draw the line. The nodes inbetween allow the spline to have a curve. The more nodes you have set between the main nodes, the more curve accuracy there will be.

The first node starts at 0. To find the last node, use the function ( path.getNumNodes() - 1 )

Parameters
pathName: The name of the path set up in the spline path editor
nodeIndex: The node index to return the position from.

Here is a Small Example of how to use this function:

function onInit(objID)
    nodeIndex = 5;
    numNodes = path.getNumNodes("MyPath");
    
    if(nodeIndex < numNodes)then
        x,y,z = path.getNodePosition("myPath", nodeIndex); -- this will return the 6 node. 
    end
end
float path::getNodeYaw ( string  pathName,
int  nodeIndex 
)

Get the yaw rotation of the node index you have passed through. This is a precalculated yaw angle created by the spline path editor.

The first node starts at 0. To find the last node, use the function ( path.getNumNodes() - 1 )

Parameters
pathName: The name of the path set up in the spline path editor
nodeIndex: The node index to return the position from.

Here is a Small Example of how to use this function:

function onInit(objID)
    nodeIndex = 5;
    numNodes = path.getNumNodes("MyPath");
    
    if(nodeIndex < numNodes)then
        yaw = path.getNodeYaw("myPath", nodeIndex); -- this will return the 6 node. 
    end
end
int path::getNumNodes ( string  pathName)

Gets how many nodes the path specified has. This also adds all the nodes in between the main nodes.

Parameters
pathName: The name of the path set up in the spline path editor.

Here is a Small Example of how to use this function:

function onInit(objID)
    numNodes = path.getNumNodes("MyPath");
    sky.lprint("nuNodes: "..numNodes);
end
path path::insertNode ( “pathName”  ,
id  ,
,
,
 
)

Insert a node into the path.

Parameters
pathName: The name of the path set up in the spline path editor.
ID:
x:
y:
z:

Here is a Small Example of how to use this function:

function onInit(objID)
    coming soon
end
path path::insertNode ( “pathName”  ,
id  ,
,
,
 
)

Insert a node into the path.

Parameters
pathName: The name of the path set up in the spline path editor.
ID:

This will insert a node between nodes at x, y, z.

Here is a Small Example of how to use this function:

function onInit(objID)
    coming soon
end
path path::removePath ( “pathName”  )

remove a Path

Parameters
pathName: The name of the path set up in the spline path editor.

Here is a Small Example of how to use this function:

function onInit(objID)
    coming soon
end
void path::setNodePosition ( string  pathName,
int  nodeIndex,
float  posX,
float  posY,
float  posZ 
)

Set the position of the node index you have passed through. This only works for the main nodes that you manually add using the Spline path editor.

Parameters
pathName: The name of the path set up in the spline path editor.
nodeIndex: The node index to set the position to.
posX: The Positions X axis variable to set.
posY: The Positions Y axis variable to set.
posZ: The Positions Z axis variable to set.

Here is a Small Example of how to use this function:

function onInit(objID)
    nodeIndex = 5;
    path.setNodePosition("MyPath", nodeIndex, 0, 10, 0);
end

The documentation for this class was generated from the following file: