Archives for: June 2007, 23

2007-06-23

Permalink 12:35:03 am, Categories: Pathfinding  

celGraph almost ready

Hello!

I will paste here the interfacte of CelGraph and its components. At the moment I am finishing some details on A* and I will soon be finishing an application for testing CelGraph and pathfinding.

include/celhraph.h:


struct iCelNode;

struct iCelEdge : public virtual iBase
{
SCF_INTERFACE (iCelEdge, 0, 0, 1);


virtual void SetState(bool open) = 0;



virtual void SetSuccessor(iCelNode* node) = 0;




virtual bool GetState() = 0;


virtual iCelNode* GetSuccessor() = 0;
};


struct iCelNode : public virtual iBase
{
SCF_INTERFACE (iCelNode, 0, 0, 1);

virtual void AddSuccessor(iCelNode* node, bool state) = 0;

virtual void SetMapNode(iMapNode* node);

virtual void Heuristic(int cost, iCelNode* goal)= 0;

virtual csVector3 GetPosition() = 0;

virtual csArray iCelNode* GetSuccessors() = 0;

virtual csArray iCelNode* GetAllSuccessors() = 0;

virtual int GetHeuristic () = 0;

virtual int GetCost () = 0;

};

struct iCelPath : public virtual iBase
{
SCF_INTERFACE (iCelPath, 0, 0, 1);

virtual void AddNode(iMapNode* node) = 0;

virtual void InsertNode(size_t pos, iMapNode* node) = 0;

virtual iMapNode* Next() = 0;

virtual iMapNode* Previous() = 0;

virtual bool HasNext();

virtual bool HasPrevious();

};

struct iCelGraph : public virtual iBase
{
SCF_INTERFACE (iCelGraph, 0, 0, 1);

virtual void AddNode(iCelNode* node) = 0;

virtual void AddEdge(iCelNode* from, iCelNode* to, bool state) = 0;

virtual iCelNode* GetClosest(csVector3 position) = 0;

virtual iCelPath* ShortestPath(iCelNode* from, iCelNode* goal) = 0;

June 2007
Mon Tue Wed Thu Fri Sat Sun
 << < Current> >>
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30  

Search

Archives

Misc

XML Feeds

What is this?

powered by
b2evolution