PixelLightAPI
.
|
A path can be set of links to graph nodes or owning it's own private nodes. More...
#include <GraphPath.h>
Public Member Functions | |
PLMATH_API | GraphPath (const PLCore::String &sName, PLCore::ResourceManager< GraphPath > *pManager=nullptr) |
Constructor. | |
PLMATH_API | GraphPath (Graph *pOwnerGraph=nullptr) |
Constructor. | |
virtual PLMATH_API | ~GraphPath () |
Destructor. | |
PLMATH_API Graph * | GetOwnerGraph () const |
Returns the owner graph of the path. | |
PLMATH_API PLCore::uint32 | GetNumOfNodes () const |
Returns the number of nodes. | |
PLMATH_API bool | AddNode (GraphNode &cNode) |
Adds a node. | |
PLMATH_API bool | RemoveNode (PLCore::uint32 nNode=0) |
Removes a node. | |
PLMATH_API const GraphNode * | GetNode (PLCore::uint32 nID=0) const |
Returns a node. | |
PLMATH_API GraphNode * | GetNode (PLCore::uint32 nID=0) |
Returns a node. | |
PLMATH_API float | GetLength () const |
Returns the length of the path. | |
PLMATH_API bool | IsClosed () const |
Returns whether the path is closed or not. | |
PLMATH_API void | SetClosed (bool bClosed=false) |
Sets if the path is closed or not. | |
PLMATH_API Vector3 | GetPosByNodeIndex (float fNodeIndex, bool bLinear=true) const |
Calculates the position at the given node index. | |
PLMATH_API Vector3 | GetPosByPercentageAlongPath (float fPercentageAlongPath, bool bLinear=true) const |
Calculates the position by using percentage along the path. | |
virtual PLMATH_API GraphPath & | operator= (const GraphPath &cSource) |
virtual PLMATH_API bool | Unload () override |
Unloads the loadable. | |
virtual PLMATH_API PLCore::String | GetLoadableTypeName () const override |
Returns the loadable type name. |
A path can be set of links to graph nodes or owning it's own private nodes.
PLMATH_API PLMath::GraphPath::GraphPath | ( | const PLCore::String & | sName, |
PLCore::ResourceManager< GraphPath > * | pManager = nullptr |
||
) |
Constructor.
[in] | sName | Resource name to set |
[in] | pManager | Resource manager using this resource, can be a null pointer |
PLMATH_API PLMath::GraphPath::GraphPath | ( | Graph * | pOwnerGraph = nullptr | ) |
Constructor.
[in] | pOwnerGraph | Owner graph, if a null pointer the path has it's own private nodes |
virtual PLMATH_API PLMath::GraphPath::~GraphPath | ( | ) | [virtual] |
Destructor.
PLMATH_API Graph* PLMath::GraphPath::GetOwnerGraph | ( | ) | const |
Returns the owner graph of the path.
PLMATH_API PLCore::uint32 PLMath::GraphPath::GetNumOfNodes | ( | ) | const |
Returns the number of nodes.
PLMATH_API bool PLMath::GraphPath::AddNode | ( | GraphNode & | cNode | ) |
Adds a node.
[in] | cNode | Node which should be added, if the path has no owner graph it will delete the node after it is no longer required. |
PLMATH_API bool PLMath::GraphPath::RemoveNode | ( | PLCore::uint32 | nNode = 0 | ) |
Removes a node.
[in] | nNode | ID of the node which should be removed |
PLMATH_API const GraphNode* PLMath::GraphPath::GetNode | ( | PLCore::uint32 | nID = 0 | ) | const |
Returns a node.
[in] | nID | ID of the node which should be returned |
PLMATH_API GraphNode* PLMath::GraphPath::GetNode | ( | PLCore::uint32 | nID = 0 | ) |
Returns a node.
[in] | nID | ID of the node which should be returned |
PLMATH_API float PLMath::GraphPath::GetLength | ( | ) | const |
Returns the length of the path.
PLMATH_API bool PLMath::GraphPath::IsClosed | ( | ) | const |
Returns whether the path is closed or not.
PLMATH_API void PLMath::GraphPath::SetClosed | ( | bool | bClosed = false | ) |
Sets if the path is closed or not.
[in] | bClosed | Should the path be closed? |
PLMATH_API Vector3 PLMath::GraphPath::GetPosByNodeIndex | ( | float | fNodeIndex, |
bool | bLinear = true |
||
) | const |
Calculates the position at the given node index.
[in] | fNodeIndex | Node index (0-<number of="" nodes>="">, automatically wrapped into that range) |
[in] | bLinear | Linear interpolation? Else a catmull rom curve is used. |
PLMATH_API Vector3 PLMath::GraphPath::GetPosByPercentageAlongPath | ( | float | fPercentageAlongPath, |
bool | bLinear = true |
||
) | const |
Calculates the position by using percentage along the path.
[in] | fPercentageAlongPath | Percentage along the path (0-1, automatically wrapped into that range) |
[in] | bLinear | Linear interpolation? Else a catmull rom curve is used. |
virtual PLMATH_API bool PLMath::GraphPath::Unload | ( | ) | [override, virtual] |
Unloads the loadable.
Reimplemented from PLCore::Loadable.
virtual PLMATH_API PLCore::String PLMath::GraphPath::GetLoadableTypeName | ( | ) | const [override, virtual] |
|