From: <la...@us...> - 2011-05-12 18:55:40
|
Revision: 7251 http://planeshift.svn.sourceforge.net/planeshift/?rev=7251&view=rev Author: landson Date: 2011-05-12 18:55:31 +0000 (Thu, 12 May 2011) Log Message: ----------- Merge with trunk - fixed some conflict issues Modified Paths: -------------- soc/2011/combat/src/tools/fparser/fp_opcode_add.inc soc/2011/combat/src/tools/fparser/fparser.cpp soc/2011/combat/src/tools/fparser/fparser.h soc/2011/combat/src/tools/fparser/fparser_gmpint.h soc/2011/combat/src/tools/fparser/fparser_mpfr.h soc/2011/combat/src/tools/fparser/fpaux.h soc/2011/combat/src/tools/fparser/fpconfig.h soc/2011/combat/src/tools/fparser/fptypes.h Added Paths: ----------- soc/2011/combat/include/tools/ soc/2011/combat/include/tools/celgraph.h soc/2011/combat/include/tools/celhpf.h soc/2011/combat/include/tools/celnavmesh.h soc/2011/combat/src/tools/fparser/docs/ soc/2011/combat/src/tools/fparser/docs/fparser.html soc/2011/combat/src/tools/fparser/docs/fparser.txt soc/2011/combat/src/tools/fparser/docs/gpl.txt soc/2011/combat/src/tools/fparser/docs/lgpl.txt soc/2011/combat/src/tools/fparser/docs/style.css Removed Paths: ------------- soc/2011/combat/include/tools/ soc/2011/combat/include/tools/celgraph.h soc/2011/combat/include/tools/celhpf.h soc/2011/combat/include/tools/celnavmesh.h soc/2011/combat/src/tools/fparser/docs/ soc/2011/combat/src/tools/fparser/docs/fparser.html soc/2011/combat/src/tools/fparser/docs/fparser.txt soc/2011/combat/src/tools/fparser/docs/gpl.txt soc/2011/combat/src/tools/fparser/docs/lgpl.txt soc/2011/combat/src/tools/fparser/docs/style.css Property Changed: ---------------- soc/2011/combat/ soc/2011/combat/data/renderlayers/ soc/2011/combat/data/shader/ soc/2011/combat/lang/1337/ soc/2011/combat/lang/englishtemplate/ soc/2011/combat/lang/french/ soc/2011/combat/lang/italian/ soc/2011/combat/src/tools/ccheck/ Property changes on: soc/2011/combat ___________________________________________________________________ Modified: svn:mergeinfo - /personal/Kayden:2590-3147 /personal/Xordan:1745,1752,1812,1838,1887,1894,2012,2014-2017,2055-2056,2062,2064,2270,2272-2273,2277-2278,2283-2284,2286-2287,2290-2291,2330,2333-2334,2336,2424,2592,2595-2596,2598-2603,2613 /trunk:7178-7186 + /personal/Kayden:2590-3147 /personal/Xordan:1745,1752,1812,1838,1887,1894,2012,2014-2017,2055-2056,2062,2064,2270,2272-2273,2277-2278,2283-2284,2286-2287,2290-2291,2330,2333-2334,2336,2424,2592,2595-2596,2598-2603,2613 /trunk:7178-7250 Property changes on: soc/2011/combat/data/renderlayers ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/data/renderlayers:7178-7186 + /trunk/data/renderlayers:7178-7250 Property changes on: soc/2011/combat/data/shader ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/data/shader:7178-7186 + /trunk/data/shader:7178-7250 Deleted: soc/2011/combat/include/tools/celgraph.h =================================================================== --- trunk/include/tools/celgraph.h 2011-05-12 04:41:41 UTC (rev 7250) +++ soc/2011/combat/include/tools/celgraph.h 2011-05-12 18:55:31 UTC (rev 7251) @@ -1,341 +0,0 @@ -/* - Crystal Space Entity Layer - Copyright (C) 2006 by Jorrit Tyberghein - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef __CEL_CELGRAPH__ -#define __CEL_CELGRAPH__ - -#include "cstypes.h" -#include "csutil/scf.h" -#include "csutil/flags.h" -#include "csutil/stringarray.h" -#include <ivaria/mapnode.h> - -struct iCelNode; - -/** - * Interface for CEL Edge. - */ -struct iCelEdge : public virtual iBase -{ - SCF_INTERFACE (iCelEdge, 1, 0, 1); - - /** - * Sets if the edge is open or closed. - */ - virtual void SetState (bool open) = 0; - - /** - * Sets successor node. - */ - virtual void SetSuccessor (iCelNode* node) = 0; - - /** - * Get state. - */ - virtual bool GetState () = 0; - - /** - * Get end-side Node. - */ - virtual iCelNode* GetSuccessor () = 0; - - /// Get weight - virtual float GetWeight () const = 0; - - /// Set weight - virtual void SetWeight (float weight) = 0; -}; - - -/** - * Interface for CEL Node. - */ -struct iCelNode : public virtual iBase -{ - SCF_INTERFACE (iCelNode, 1, 0, 3); - - /** - * Adds a successor to this node (This will create a new edge). - */ - virtual size_t AddSuccessor (iCelNode* node, bool state) = 0; - - /** - * Sets mapnode of this node. - */ - virtual void SetMapNode (iMapNode* node) = 0; - - /** - * Sets parent to this node. - */ - virtual void SetParent (iCelNode* par)= 0; - - /** - * Calculates euclidean distance between this node and goal. - */ - virtual void SetName (const char* par)= 0; - - /** - * Calculates euclidean distance between this node and goal. - */ - virtual void Heuristic (float cost, iCelNode* goal)= 0; - - /** - * Get MapNode of this node. - */ - virtual iMapNode* GetMapNode () = 0; - - /** - * Get position of this node. - */ - virtual csVector3 GetPosition () = 0; - - /** - * Get name of this node. - */ - virtual const char* GetName () = 0; - - /** - * Get Parent to this node. - */ - virtual iCelNode* GetParent () = 0; - - /** - * Get reachable successors to this node. - */ - virtual csArray<iCelNode*> GetSuccessors () = 0; - - /** - * Get all successors to this node. - */ - virtual csArray<iCelNode*> GetAllSuccessors () = 0; - - /** - * Get stored heuristic. - */ - virtual float GetHeuristic () = 0; - - /** - * Get stored cost. - */ - virtual float GetCost () = 0; - - /** - * Get Number of Edges. - */ - virtual size_t GetEdgeCount () = 0; - - /** - * Get a node by index. - */ - virtual iCelEdge* GetEdge (size_t idx) = 0; - - /** - * Remove an edge. - */ - virtual void RemoveEdge (size_t idx) = 0; - - /** - * Adds a successor to this node, using a weight different then the euclidean - * distance between the two nodes (This will create a new edge). - */ - virtual size_t AddSuccessor (iCelNode* node, bool state, float weight) = 0; - - /** - * Get edges. - */ - virtual csRefArray<iCelEdge> GetEdges () const = 0; -}; - - -/** - * Interface for CEL Path. - */ -struct iCelPath : public virtual iBase -{ - SCF_INTERFACE (iCelPath, 2, 0, 1); - - /** - * Query the underlying iObject - */ - virtual iObject* QueryObject () = 0; - - /** - * Adds a new node at the end of the path. - */ - virtual void AddNode (iMapNode* node) = 0; - - /** - * Adds a new node in position pos. - */ - virtual void InsertNode (size_t pos, iMapNode* node) = 0; - - /** - * Get next node in path. - */ - virtual iMapNode* Next () = 0; - - /** - * Get previous node in path. - */ - virtual iMapNode* Previous () = 0; - - /** - * Get current node in path. - */ - virtual iMapNode* Current () = 0; - - /** - * Get currents node position. - */ - virtual csVector3 CurrentPosition () = 0; - - /** - * Get currents node sector. - */ - virtual iSector* CurrentSector () = 0; - - /** - * Checks if there are more nodes ahead in the path. - */ - virtual bool HasNext () = 0; - - /** - * Checks if there are more nodes back in the path. - */ - virtual bool HasPrevious () = 0; - - /** - * Restarts path - */ - virtual void Restart () = 0; - - /** - * Clears path - */ - virtual void Clear () = 0; - - /** - * Get First node in path. - */ - virtual iMapNode* GetFirst () = 0; - - /** - * Get last node in path. - */ - virtual iMapNode* GetLast () = 0; - - /** - * Invert nodes in the path. - */ - virtual void Invert () = 0; - - /** - * Get number of nodes in the path. - */ - virtual size_t GetNodeCount () = 0; -}; - - -/** - * Interface for the CEL Graph. - */ -struct iCelGraph : public virtual iBase -{ - SCF_INTERFACE (iCelGraph, 1, 0, 4); - - /** - * Query the underlying iObject - */ - virtual iObject* QueryObject () = 0; - - /** - * Create a node for this graph. The node will be added to the graph. - */ - virtual iCelNode* CreateNode (const char* name, csVector3 &pos) = 0; - - /** - * Adds a node to the graph. - */ - virtual size_t AddNode (iCelNode* node) = 0; - - /** - * Adds an edge to the graph. - */ - virtual void AddEdge (iCelNode* from, iCelNode* to, bool state) = 0; - - /** - * Adds an edge to the graph. - */ - virtual bool AddEdgeByNames (const char* from, const char* to, bool state) = 0; - - /** - * Gets the closest node to position. - */ - virtual iCelNode* GetClosest (csVector3 position) = 0; - - /** - * Gets the shortest path from node from to node to. - */ - virtual bool ShortestPath (iCelNode* from, iCelNode* goal, iCelPath* path) = 0; - - /** - * Gets the shortest path from node from to node to. - */ - virtual iCelNode* RandomPath (iCelNode* from, int distance, iCelPath* path) = 0; - - /** - * Get Number of Nodes - */ - virtual size_t GetNodeCount () = 0; - - /** - * Get a node by index - */ - virtual iCelNode* GetNode (size_t idx) = 0; - - /** - * Removes a node from the graph. - */ - virtual void RemoveNode (size_t idx) = 0; - - /** - * Removes an edge from the graph. - */ - virtual void RemoveEdge (iCelNode* from, size_t idx) = 0; - - /** - * Adds an edge to the graph, using a weight different then the euclidean - * distance between the two nodes. - */ - virtual size_t AddEdge (iCelNode* from, iCelNode* to, bool state, float weight) = 0; - - /** - * Creates an empty node and adds it to the graph. - */ - virtual iCelNode* CreateEmptyNode (size_t& index) = 0; - - /** - * Gets the shortest path from node from to node to. - */ - virtual bool ShortestPath2 (iCelNode* from, iCelNode* goal, iCelPath* path) = 0; - -}; - -#endif //__CEL_CELGRAPH__ - Copied: soc/2011/combat/include/tools/celgraph.h (from rev 7250, trunk/include/tools/celgraph.h) =================================================================== --- soc/2011/combat/include/tools/celgraph.h (rev 0) +++ soc/2011/combat/include/tools/celgraph.h 2011-05-12 18:55:31 UTC (rev 7251) @@ -0,0 +1,341 @@ +/* + Crystal Space Entity Layer + Copyright (C) 2006 by Jorrit Tyberghein + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef __CEL_CELGRAPH__ +#define __CEL_CELGRAPH__ + +#include "cstypes.h" +#include "csutil/scf.h" +#include "csutil/flags.h" +#include "csutil/stringarray.h" +#include <ivaria/mapnode.h> + +struct iCelNode; + +/** + * Interface for CEL Edge. + */ +struct iCelEdge : public virtual iBase +{ + SCF_INTERFACE (iCelEdge, 1, 0, 1); + + /** + * Sets if the edge is open or closed. + */ + virtual void SetState (bool open) = 0; + + /** + * Sets successor node. + */ + virtual void SetSuccessor (iCelNode* node) = 0; + + /** + * Get state. + */ + virtual bool GetState () = 0; + + /** + * Get end-side Node. + */ + virtual iCelNode* GetSuccessor () = 0; + + /// Get weight + virtual float GetWeight () const = 0; + + /// Set weight + virtual void SetWeight (float weight) = 0; +}; + + +/** + * Interface for CEL Node. + */ +struct iCelNode : public virtual iBase +{ + SCF_INTERFACE (iCelNode, 1, 0, 3); + + /** + * Adds a successor to this node (This will create a new edge). + */ + virtual size_t AddSuccessor (iCelNode* node, bool state) = 0; + + /** + * Sets mapnode of this node. + */ + virtual void SetMapNode (iMapNode* node) = 0; + + /** + * Sets parent to this node. + */ + virtual void SetParent (iCelNode* par)= 0; + + /** + * Calculates euclidean distance between this node and goal. + */ + virtual void SetName (const char* par)= 0; + + /** + * Calculates euclidean distance between this node and goal. + */ + virtual void Heuristic (float cost, iCelNode* goal)= 0; + + /** + * Get MapNode of this node. + */ + virtual iMapNode* GetMapNode () = 0; + + /** + * Get position of this node. + */ + virtual csVector3 GetPosition () = 0; + + /** + * Get name of this node. + */ + virtual const char* GetName () = 0; + + /** + * Get Parent to this node. + */ + virtual iCelNode* GetParent () = 0; + + /** + * Get reachable successors to this node. + */ + virtual csArray<iCelNode*> GetSuccessors () = 0; + + /** + * Get all successors to this node. + */ + virtual csArray<iCelNode*> GetAllSuccessors () = 0; + + /** + * Get stored heuristic. + */ + virtual float GetHeuristic () = 0; + + /** + * Get stored cost. + */ + virtual float GetCost () = 0; + + /** + * Get Number of Edges. + */ + virtual size_t GetEdgeCount () = 0; + + /** + * Get a node by index. + */ + virtual iCelEdge* GetEdge (size_t idx) = 0; + + /** + * Remove an edge. + */ + virtual void RemoveEdge (size_t idx) = 0; + + /** + * Adds a successor to this node, using a weight different then the euclidean + * distance between the two nodes (This will create a new edge). + */ + virtual size_t AddSuccessor (iCelNode* node, bool state, float weight) = 0; + + /** + * Get edges. + */ + virtual csRefArray<iCelEdge> GetEdges () const = 0; +}; + + +/** + * Interface for CEL Path. + */ +struct iCelPath : public virtual iBase +{ + SCF_INTERFACE (iCelPath, 2, 0, 1); + + /** + * Query the underlying iObject + */ + virtual iObject* QueryObject () = 0; + + /** + * Adds a new node at the end of the path. + */ + virtual void AddNode (iMapNode* node) = 0; + + /** + * Adds a new node in position pos. + */ + virtual void InsertNode (size_t pos, iMapNode* node) = 0; + + /** + * Get next node in path. + */ + virtual iMapNode* Next () = 0; + + /** + * Get previous node in path. + */ + virtual iMapNode* Previous () = 0; + + /** + * Get current node in path. + */ + virtual iMapNode* Current () = 0; + + /** + * Get currents node position. + */ + virtual csVector3 CurrentPosition () = 0; + + /** + * Get currents node sector. + */ + virtual iSector* CurrentSector () = 0; + + /** + * Checks if there are more nodes ahead in the path. + */ + virtual bool HasNext () = 0; + + /** + * Checks if there are more nodes back in the path. + */ + virtual bool HasPrevious () = 0; + + /** + * Restarts path + */ + virtual void Restart () = 0; + + /** + * Clears path + */ + virtual void Clear () = 0; + + /** + * Get First node in path. + */ + virtual iMapNode* GetFirst () = 0; + + /** + * Get last node in path. + */ + virtual iMapNode* GetLast () = 0; + + /** + * Invert nodes in the path. + */ + virtual void Invert () = 0; + + /** + * Get number of nodes in the path. + */ + virtual size_t GetNodeCount () = 0; +}; + + +/** + * Interface for the CEL Graph. + */ +struct iCelGraph : public virtual iBase +{ + SCF_INTERFACE (iCelGraph, 1, 0, 4); + + /** + * Query the underlying iObject + */ + virtual iObject* QueryObject () = 0; + + /** + * Create a node for this graph. The node will be added to the graph. + */ + virtual iCelNode* CreateNode (const char* name, csVector3 &pos) = 0; + + /** + * Adds a node to the graph. + */ + virtual size_t AddNode (iCelNode* node) = 0; + + /** + * Adds an edge to the graph. + */ + virtual void AddEdge (iCelNode* from, iCelNode* to, bool state) = 0; + + /** + * Adds an edge to the graph. + */ + virtual bool AddEdgeByNames (const char* from, const char* to, bool state) = 0; + + /** + * Gets the closest node to position. + */ + virtual iCelNode* GetClosest (csVector3 position) = 0; + + /** + * Gets the shortest path from node from to node to. + */ + virtual bool ShortestPath (iCelNode* from, iCelNode* goal, iCelPath* path) = 0; + + /** + * Gets the shortest path from node from to node to. + */ + virtual iCelNode* RandomPath (iCelNode* from, int distance, iCelPath* path) = 0; + + /** + * Get Number of Nodes + */ + virtual size_t GetNodeCount () = 0; + + /** + * Get a node by index + */ + virtual iCelNode* GetNode (size_t idx) = 0; + + /** + * Removes a node from the graph. + */ + virtual void RemoveNode (size_t idx) = 0; + + /** + * Removes an edge from the graph. + */ + virtual void RemoveEdge (iCelNode* from, size_t idx) = 0; + + /** + * Adds an edge to the graph, using a weight different then the euclidean + * distance between the two nodes. + */ + virtual size_t AddEdge (iCelNode* from, iCelNode* to, bool state, float weight) = 0; + + /** + * Creates an empty node and adds it to the graph. + */ + virtual iCelNode* CreateEmptyNode (size_t& index) = 0; + + /** + * Gets the shortest path from node from to node to. + */ + virtual bool ShortestPath2 (iCelNode* from, iCelNode* goal, iCelPath* path) = 0; + +}; + +#endif //__CEL_CELGRAPH__ + Deleted: soc/2011/combat/include/tools/celhpf.h =================================================================== --- trunk/include/tools/celhpf.h 2011-05-12 04:41:41 UTC (rev 7250) +++ soc/2011/combat/include/tools/celhpf.h 2011-05-12 18:55:31 UTC (rev 7251) @@ -1,209 +0,0 @@ -/* - Crystal Space Entity Layer - Copyright (C) 2010 by Leonardo Rodrigo Domingues - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef __CEL_HPFAPI__ -#define __CEL_HPFAPI__ - -#include <csutil/scf.h> -#include <csutil/list.h> -#include <tools/celnavmesh.h> - -class csBox3; -class csOBB; -class csString; -class csVector3; -struct csSimpleRenderMesh; -struct iCelNavMeshParams; -struct iCelPath; -struct iSector; -struct iSectorList; -struct iMapNode; - - - -/** - * Hierarchical path between two points. - */ -struct iCelHPath : public virtual iBase -{ - SCF_INTERFACE (iCelHPath, 1, 0, 0); - - /// Check if the path can be transversed forward from the current position. - virtual bool HasNext () const = 0; - - /// Check if the path can be transversed backward from the current position. - virtual bool HasPrevious () const = 0; - - /// Get next node. - virtual iMapNode* Next () = 0; - - /// Get previous node. - virtual iMapNode* Previous () = 0; - - /// Get current node. - virtual iMapNode* Current () = 0; - - /// Get first node. - virtual iMapNode* GetFirst () = 0; - - /// Get last node. - virtual iMapNode* GetLast () = 0; - - /// Invert path. - virtual void Invert () = 0; - - /// Restart path. - virtual void Restart () = 0; - - /// Distance to goal. - virtual float GetDistance () const = 0; - - /** - * Render path. - * \remarks The user is responsible for freeing the returned pointer. - */ - virtual csList<csSimpleRenderMesh>* GetDebugMeshes () = 0; -}; - - - -/** - * Hierarchical navigation structure representing the navigable areas of a Map. - */ -struct iCelHNavStruct : public virtual iBase -{ - SCF_INTERFACE (iCelHNavStruct, 1, 0, 0); - - /** - * Find the shortest path between two points. - * \param from Origin coordinates. - * \param fromSector Origin sector. - * \param goal Destination coordinates. - * \param goalSector Destination sector. - * \return Pointer to the shortest path between the two points, or 0 in case something went wrong. - * \remarks The path returned by this method will be rendered useless if the originating iCelHNavStruct - * is destroyed. - */ - virtual iCelHPath* ShortestPath (const csVector3& from, iSector* fromSector, const csVector3& goal, - iSector* goalSector) = 0; - - /** - * Find the shortest path between two points. - * \param from Origin of the path. - * \param goal Destination of the path. - * \return Pointer to the shortest path between the two points, or 0 in case something went wrong. - * \remarks The path returned by this method will be rendered useless if the originating iCelHNavStruct - * is destroyed. - */ - virtual iCelHPath* ShortestPath (iMapNode* from, iMapNode* goal) = 0; - - /** - * Update the tiles of the hierarchical navigation structure that intersect with an axis aligned bounding box. - * \param boundingBox Bounding box representing the area to be updated. - * \param sector Only update tiles from this sector, if specified. - * \return True in case everything went right and false otherwise. - * \remarks A sector should be specified whenever possible. - */ - virtual bool Update (const csBox3& boundingBox, iSector* sector = 0) = 0; - - /** - * Update the tiles of the hierarchical navigation structure that intersect with an oriented bounding box. - * \param boundingBox Bounding box representing the area to be updated. - * \param sector Only update tiles from this sector, if specified. - * \return True in case everything went right and false otherwise. - * \remarks A sector should be specified whenever possible. - */ - virtual bool Update (const csOBB& boundingBox, iSector* sector = 0) = 0; - - /** - * Save this structure to a file. - * \param vfs Pointer to the virtual file system. The file will be saved the file at the current directory - * of this file system. - * \param file File name. - * \return True in case everything went right and false otherwise. - */ - virtual bool SaveToFile (iVFS* vfs, const char* directory) = 0; - - /** - * Get an object representation of the navigation mesh parameters. - * \return Pointer to navigation mesh parameters object. - */ - virtual const iCelNavMeshParams* GetNavMeshParams () const = 0; - - /** - * Render navigation structure. - * \remarks The user is responsible for freeing the returned pointer. - */ - virtual csList<csSimpleRenderMesh>* GetDebugMeshes () const = 0; - - /** - * Render proxy agent of the specified color. - * \remarks The user is responsible for freeing the returned pointer. - */ - virtual csList<csSimpleRenderMesh>* GetAgentDebugMeshes (const csVector3& pos, int red, int green, - int blue, int alpha) const = 0; -}; - - - -/** - * Hierarchical navigation struct creator. - */ -struct iCelHNavStructBuilder : public virtual iBase -{ - SCF_INTERFACE (iCelHNavStructBuilder, 1, 0, 0); - - /** - * Set the Sectors used to build the navigation structure. - * \param sectorList List containing the sectors for which navmeshes will be built. - * \return True in case everything went right and false otherwise. - * \remarks Even in case of a false return, the old sector information is lost. - * You should call iCelHNavStructBuilder::SetNavMeshParams() before this method. - */ - virtual bool SetSectors(csList<iSector*> sectorList) = 0; - - /** - * Build a hierarchical navigation structure using the current configurations. - * \return Pointer to the navigation mesh, or 0 if something went wrong. - */ - virtual iCelHNavStruct* BuildHNavStruct () = 0; - - /** - * Load a hierarchical navigation structure from a file. - * \param vfs Pointer to the virtual file system. The file will be loaded from the current directory - * of this file system. - * \param directory Directory name (vfs path). - * \return Pointer to the navigation mesh, or 0 if something went wrong. - */ - virtual iCelHNavStruct* LoadHNavStruct (iVFS* vfs, const char* directory) = 0; - - /** - * Get an object representation of the navigation mesh parameters. - * \return Pointer to navigation mesh parameters object. - */ - virtual const iCelNavMeshParams* GetNavMeshParams () const = 0; - - /** - * Set navigation mesh parameters. - * \remarks Should be called before iCelHNavStructBuilder::SetSectors(). - */ - virtual void SetNavMeshParams (const iCelNavMeshParams* parameters) = 0; -}; - -#endif // __CEL_HPFAPI__ Copied: soc/2011/combat/include/tools/celhpf.h (from rev 7250, trunk/include/tools/celhpf.h) =================================================================== --- soc/2011/combat/include/tools/celhpf.h (rev 0) +++ soc/2011/combat/include/tools/celhpf.h 2011-05-12 18:55:31 UTC (rev 7251) @@ -0,0 +1,209 @@ +/* + Crystal Space Entity Layer + Copyright (C) 2010 by Leonardo Rodrigo Domingues + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef __CEL_HPFAPI__ +#define __CEL_HPFAPI__ + +#include <csutil/scf.h> +#include <csutil/list.h> +#include <tools/celnavmesh.h> + +class csBox3; +class csOBB; +class csString; +class csVector3; +struct csSimpleRenderMesh; +struct iCelNavMeshParams; +struct iCelPath; +struct iSector; +struct iSectorList; +struct iMapNode; + + + +/** + * Hierarchical path between two points. + */ +struct iCelHPath : public virtual iBase +{ + SCF_INTERFACE (iCelHPath, 1, 0, 0); + + /// Check if the path can be transversed forward from the current position. + virtual bool HasNext () const = 0; + + /// Check if the path can be transversed backward from the current position. + virtual bool HasPrevious () const = 0; + + /// Get next node. + virtual iMapNode* Next () = 0; + + /// Get previous node. + virtual iMapNode* Previous () = 0; + + /// Get current node. + virtual iMapNode* Current () = 0; + + /// Get first node. + virtual iMapNode* GetFirst () = 0; + + /// Get last node. + virtual iMapNode* GetLast () = 0; + + /// Invert path. + virtual void Invert () = 0; + + /// Restart path. + virtual void Restart () = 0; + + /// Distance to goal. + virtual float GetDistance () const = 0; + + /** + * Render path. + * \remarks The user is responsible for freeing the returned pointer. + */ + virtual csList<csSimpleRenderMesh>* GetDebugMeshes () = 0; +}; + + + +/** + * Hierarchical navigation structure representing the navigable areas of a Map. + */ +struct iCelHNavStruct : public virtual iBase +{ + SCF_INTERFACE (iCelHNavStruct, 1, 0, 0); + + /** + * Find the shortest path between two points. + * \param from Origin coordinates. + * \param fromSector Origin sector. + * \param goal Destination coordinates. + * \param goalSector Destination sector. + * \return Pointer to the shortest path between the two points, or 0 in case something went wrong. + * \remarks The path returned by this method will be rendered useless if the originating iCelHNavStruct + * is destroyed. + */ + virtual iCelHPath* ShortestPath (const csVector3& from, iSector* fromSector, const csVector3& goal, + iSector* goalSector) = 0; + + /** + * Find the shortest path between two points. + * \param from Origin of the path. + * \param goal Destination of the path. + * \return Pointer to the shortest path between the two points, or 0 in case something went wrong. + * \remarks The path returned by this method will be rendered useless if the originating iCelHNavStruct + * is destroyed. + */ + virtual iCelHPath* ShortestPath (iMapNode* from, iMapNode* goal) = 0; + + /** + * Update the tiles of the hierarchical navigation structure that intersect with an axis aligned bounding box. + * \param boundingBox Bounding box representing the area to be updated. + * \param sector Only update tiles from this sector, if specified. + * \return True in case everything went right and false otherwise. + * \remarks A sector should be specified whenever possible. + */ + virtual bool Update (const csBox3& boundingBox, iSector* sector = 0) = 0; + + /** + * Update the tiles of the hierarchical navigation structure that intersect with an oriented bounding box. + * \param boundingBox Bounding box representing the area to be updated. + * \param sector Only update tiles from this sector, if specified. + * \return True in case everything went right and false otherwise. + * \remarks A sector should be specified whenever possible. + */ + virtual bool Update (const csOBB& boundingBox, iSector* sector = 0) = 0; + + /** + * Save this structure to a file. + * \param vfs Pointer to the virtual file system. The file will be saved the file at the current directory + * of this file system. + * \param file File name. + * \return True in case everything went right and false otherwise. + */ + virtual bool SaveToFile (iVFS* vfs, const char* directory) = 0; + + /** + * Get an object representation of the navigation mesh parameters. + * \return Pointer to navigation mesh parameters object. + */ + virtual const iCelNavMeshParams* GetNavMeshParams () const = 0; + + /** + * Render navigation structure. + * \remarks The user is responsible for freeing the returned pointer. + */ + virtual csList<csSimpleRenderMesh>* GetDebugMeshes () const = 0; + + /** + * Render proxy agent of the specified color. + * \remarks The user is responsible for freeing the returned pointer. + */ + virtual csList<csSimpleRenderMesh>* GetAgentDebugMeshes (const csVector3& pos, int red, int green, + int blue, int alpha) const = 0; +}; + + + +/** + * Hierarchical navigation struct creator. + */ +struct iCelHNavStructBuilder : public virtual iBase +{ + SCF_INTERFACE (iCelHNavStructBuilder, 1, 0, 0); + + /** + * Set the Sectors used to build the navigation structure. + * \param sectorList List containing the sectors for which navmeshes will be built. + * \return True in case everything went right and false otherwise. + * \remarks Even in case of a false return, the old sector information is lost. + * You should call iCelHNavStructBuilder::SetNavMeshParams() before this method. + */ + virtual bool SetSectors(csList<iSector*> sectorList) = 0; + + /** + * Build a hierarchical navigation structure using the current configurations. + * \return Pointer to the navigation mesh, or 0 if something went wrong. + */ + virtual iCelHNavStruct* BuildHNavStruct () = 0; + + /** + * Load a hierarchical navigation structure from a file. + * \param vfs Pointer to the virtual file system. The file will be loaded from the current directory + * of this file system. + * \param directory Directory name (vfs path). + * \return Pointer to the navigation mesh, or 0 if something went wrong. + */ + virtual iCelHNavStruct* LoadHNavStruct (iVFS* vfs, const char* directory) = 0; + + /** + * Get an object representation of the navigation mesh parameters. + * \return Pointer to navigation mesh parameters object. + */ + virtual const iCelNavMeshParams* GetNavMeshParams () const = 0; + + /** + * Set navigation mesh parameters. + * \remarks Should be called before iCelHNavStructBuilder::SetSectors(). + */ + virtual void SetNavMeshParams (const iCelNavMeshParams* parameters) = 0; +}; + +#endif // __CEL_HPFAPI__ Deleted: soc/2011/combat/include/tools/celnavmesh.h =================================================================== --- trunk/include/tools/celnavmesh.h 2011-05-12 04:41:41 UTC (rev 7250) +++ soc/2011/combat/include/tools/celnavmesh.h 2011-05-12 18:55:31 UTC (rev 7251) @@ -1,310 +0,0 @@ -/* - Crystal Space Entity Layer - Copyright (C) 2010 by Leonardo Rodrigo Domingues - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#ifndef __CEL_NAVMESHAPI__ -#define __CEL_NAVMESHAPI__ - -#include <csutil/scf.h> -#include <csutil/list.h> -#include <csgeom/poly3d.h> - -class csBox3; -class csOBB; -class csVector3; -struct csSimpleRenderMesh; -struct iFile; -struct iSector; - - - -/** - * Wrapper for the parameters used to build the navigation mesh - */ -struct iCelNavMeshParams : public virtual iBase -{ - /** - * Create a new object with the same instance variable's values as this one's - * \remarks Don't assign the returned value directly to a smart pointer. Use the AttachNew() - * method instead. - */ - virtual iCelNavMeshParams* Clone () const = 0; - - /// Set suggested values, given the agent parameters values - virtual void SetSuggestedValues (float agentHeight, float agentRadius, float agentMaxSlopeAngle) = 0; - - /// Get agent height - virtual float GetAgentHeight () const = 0; - /// Set agent height - virtual void SetAgentHeight (const float height) = 0; - - /// Get agent radius - virtual float GetAgentRadius () const = 0; - /// Set agent radius - virtual void SetAgentRadius (const float radius) = 0; - - /// Get agent maximum walkable slope angle (in degrees) - virtual float GetAgentMaxSlopeAngle () const = 0; - /// Set agent maximum walkable slope angle (in degrees) - virtual void SetAgentMaxSlopeAngle (const float angle) = 0; - - /// Get agent max climb - virtual float GetAgentMaxClimb () const = 0; - /// Set agent max climb - virtual void SetAgentMaxClimb (const float maxClimb) = 0; - - /// Get cell size - virtual float GetCellSize () const = 0; - /// Set cell size - virtual void SetCellSize (const float size) = 0; - - /// Get cell height - virtual float GetCellHeight () const = 0; - /// Set cell height - virtual void SetCellHeight (const float height) = 0; - - /// Get maximum distance error from contour to cells - virtual float GetMaxSimplificationError () const = 0; - /// Set maximum distance error from contour to cells - virtual void SetMaxSimplificationError (const float error) = 0; - - /// Get detail mesh sample spacing - virtual float GetDetailSampleDist () const = 0; - /// Set detail mesh sample spacing - virtual void SetDetailSampleDist (const float dist) = 0; - - /// Get detail mesh simplification max sample error - virtual float GetDetailSampleMaxError () const = 0; - /// Set detail mesh simplification max sample error - virtual void SetDetailSampleMaxError (const float error) = 0; - - /// Get maximum contour edge length - virtual int GetMaxEdgeLength () const = 0; - /// Set maximum contour edge length - virtual void SetMaxEdgeLength (const int length) = 0; - - /// Get minimum regions size (smaller regions will be deleted) - virtual int GetMinRegionSize () const = 0; - /// Set minimum regions size (smaller regions will be deleted) - virtual void SetMinRegionSize (const int size) = 0; - - /// Get minimum regions size (smaller regions will be merged) - virtual int GetMergeRegionSize () const = 0; - /// Set minimum regions size (smaller regions will be merged) - virtual void SetMergeRegionSize (const int size) = 0; - - /// Get max number of vertices per polygon - virtual int GetMaxVertsPerPoly () const = 0; - /// Set max number of vertices per polygon - virtual void SetMaxVertsPerPoly (const int maxVerts) = 0; - - /// Get tile size (Width and Height of a tile) - virtual int GetTileSize () const = 0; - /// Set tile size (Width and Height of a tile) - virtual void SetTileSize (const int size) = 0; - - /// Get border size - virtual int GetBorderSize () const = 0; - /// Set border size - virtual void SetBorderSize (const int size) = 0; - - /// Set the size of the polygon search bounding box - virtual csVector3 GetPolygonSearchBox () const = 0; - /// Get the size of the polygon search bounding box - virtual void SetPolygonSearchBox (const csVector3 box) = 0; -}; - - - -/** - * Path between two points which lay in the same Sector. - */ -struct iCelNavMeshPath : public virtual iBase -{ - SCF_INTERFACE (iCelNavMeshPath, 1, 0, 0); - - /// Get this path's sector - virtual iSector* GetSector () const = 0; - - /// Get current node from the navigation path - virtual void Current (csVector3& vector) const = 0; - - /// Get next node from the navigation path - virtual void Next (csVector3& vector) = 0; - - /// Get previous node from the navigation path - virtual void Previous (csVector3& vector) = 0; - - /// Get first node from the navigation path - virtual void GetFirst (csVector3& vector) const = 0; - - /// Get last node from the navigation path - virtual void GetLast (csVector3& vector) const = 0; - - /// Check if the navigation mesh has nodes after the current one - virtual bool HasNext () const = 0; - - /// Check if the navigation mesh has nodes before the current one - virtual bool HasPrevious () const = 0; - - /// Invert the navigation path - virtual void Invert () = 0; - - /// Restart the navigation path - virtual void Restart () = 0; - - /// Add a new node at the end of the path - virtual void AddNode (csVector3 node) = 0; - - /// Add a new node in position pos - virtual void InsertNode (int pos, csVector3 node) = 0; - - /// Calculate path length - virtual float Length() const = 0; - - /// Get the number of nodes in this path - virtual int GetNodeCount () const = 0; - - /** - * Render path. - * \remarks The user is responsible for freeing the returned pointer. - */ - virtual csList<csSimpleRenderMesh>* GetDebugMeshes () const = 0; -}; - - - -/** - * Polygon mesh representing the navigable areas of a Sector. - */ -struct iCelNavMesh : public virtual iBase -{ - SCF_INTERFACE (iCelNavMesh, 1, 0, 0); - - /** - * Find the shortest path between two points. - * \param from Origin of the path. - * \param goal Destination of the path. - * \return Pointer to the shortest path between the two points, or 0 in case - * something went wrong. - */ - virtual iCelNavMeshPath* ShortestPath (const csVector3& from, const csVector3& goal, - int maxPathSize = 32) = 0; - - /** - * Update the tiles of the navigation mesh that intersect with an axis aligned bounding box. - * \param boundingBox Bounding box representing the area to be updated. - * \return True in case everything went right and false otherwise. - */ - virtual bool Update (const csBox3& boundingBox) = 0; - - /** - * Update the tiles of the navigation mesh that intersect with an oriented bounding box. - * \param boundingBox Bounding box representing the area to be updated. - * \return True in case everything went right and false otherwise. - */ - virtual bool Update (const csOBB& boundingBox) = 0; - - /// Get navigation mesh sector - virtual iSector* GetSector () const = 0; - - /// Set navigation mesh sector - virtual void SetSector (iSector* sector) = 0; - - /// Get navigation mesh parameters - virtual iCelNavMeshParams* GetParameters () const = 0; - - /// Get navigation mesh bounding box - virtual csBox3 GetBoundingBox() const = 0; - - // obtain a list of polygons overlapping a box - virtual csArray<csPoly3D> QueryPolygons(const csBox3& box) const = 0; - - /// Save to file - virtual bool SaveToFile (iFile* file) const = 0; - - /** - * Render navigation mesh. - * \remarks The user is responsible for freeing the returned pointer. - */ - virtual csList<csSimpleRenderMesh>* GetDebugMeshes () const = 0; - - /** - * Render proxy agent. - * \remarks The user is responsible for freeing the returned pointer. - */ - virtual csList<csSimpleRenderMesh>* GetAgentDebugMeshes (const csVector3& pos) const = 0; - - /** - * Render proxy agent of the specified color. - * \remarks The user is responsible for freeing the returned pointer. - */ - virtual csList<csSimpleRenderMesh>* GetAgentDebugMeshes (const csVector3& pos, int red, int green, - int blue, int alpha) const = 0; -}; - - - -/** - * Navigation mesh creator. - */ -struct iCelNavMeshBuilder : public virtual iBase -{ - SCF_INTERFACE (iCelNavMeshBuilder, 1, 0, 0); - - /** - * Set an iSector as the current working sector and loads it's triangles. - * \param sector Pointer to the new iSector. - * \return True in case everything went right and false otherwise. - * \remarks Even in case of a false return, the old sector information is lost. - * You should call iCelNavMeshBuilder::SetNavMeshParams() before this method. - */ - virtual bool SetSector (iSector* sector) = 0; - - /** - * Build a navigation mesh from the triangles in a Sector, using current configuration. - * \return Pointer to the navigation mesh, or 0 if something went wrong. - * \remarks A valid iSector must have been set using iCelNavMeshBuilder::SetSector() - * before calling this method. - */ - THREADED_INTERFACE(BuildNavMesh); - - /** - * Load a navigation mesh from a file. - * \param file Pointer to file in the virtual filesystem. - * \return Pointer to the navigation mesh, or 0 if something went wrong. - */ - virtual iCelNavMesh* LoadNavMesh (iFile* file) = 0; - - /** - * Get an object representation of the navigation mesh parameters. - * \return Pointer to navigation mesh parameters object. - */ - virtual const iCelNavMeshParams* GetNavMeshParams () const = 0; - - /** - * Set navigation mesh parameters. - * \remarks Should be called before iCelNavMeshBuilder::SetSector(). - */ - virtual void SetNavMeshParams (const iCelNavMeshParams* parameters) = 0; - - virtual iSector* GetSector () const = 0; - -}; - -#endif // __CEL_NAVMESHAPI__ Copied: soc/2011/combat/include/tools/celnavmesh.h (from rev 7250, trunk/include/tools/celnavmesh.h) =================================================================== --- soc/2011/combat/include/tools/celnavmesh.h (rev 0) +++ soc/2011/combat/include/tools/celnavmesh.h 2011-05-12 18:55:31 UTC (rev 7251) @@ -0,0 +1,310 @@ +/* + Crystal Space Entity Layer + Copyright (C) 2010 by Leonardo Rodrigo Domingues + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef __CEL_NAVMESHAPI__ +#define __CEL_NAVMESHAPI__ + +#include <csutil/scf.h> +#include <csutil/list.h> +#include <csgeom/poly3d.h> + +class csBox3; +class csOBB; +class csVector3; +struct csSimpleRenderMesh; +struct iFile; +struct iSector; + + + +/** + * Wrapper for the parameters used to build the navigation mesh + */ +struct iCelNavMeshParams : public virtual iBase +{ + /** + * Create a new object with the same instance variable's values as this one's + * \remarks Don't assign the returned value directly to a smart pointer. Use the AttachNew() + * method instead. + */ + virtual iCelNavMeshParams* Clone () const = 0; + + /// Set suggested values, given the agent parameters values + virtual void SetSuggestedValues (float agentHeight, float agentRadius, float agentMaxSlopeAngle) = 0; + + /// Get agent height + virtual float GetAgentHeight () const = 0; + /// Set agent height + virtual void SetAgentHeight (const float height) = 0; + + /// Get agent radius + virtual float GetAgentRadius () const = 0; + /// Set agent radius + virtual void SetAgentRadius (const float radius) = 0; + + /// Get agent maximum walkable slope angle (in degrees) + virtual float GetAgentMaxSlopeAngle () const = 0; + /// Set agent maximum walkable slope angle (in degrees) + virtual void SetAgentMaxSlopeAngle (const float angle) = 0; + + /// Get agent max climb + virtual float GetAgentMaxClimb () const = 0; + /// Set agent max climb + virtual void SetAgentMaxClimb (const float maxClimb) = 0; + + /// Get cell size + virtual float GetCellSize () const = 0; + /// Set cell size + virtual void SetCellSize (const float size) = 0; + + /// Get cell height + virtual float GetCellHeight () const = 0; + /// Set cell height + virtual void SetCellHeight (const float height) = 0; + + /// Get maximum distance error from contour to cells + virtual float GetMaxSimplificationError () const = 0; + /// Set maximum distance error from contour to cells + virtual void SetMaxSimplificationError (const float error) = 0; + + /// Get detail mesh sample spacing + virtual float GetDetailSampleDist () const = 0; + /// Set detail mesh sample spacing + virtual void SetDetailSampleDist (const float dist) = 0; + + /// Get detail mesh simplification max sample error + virtual float GetDetailSampleMaxError () const = 0; + /// Set detail mesh simplification max sample error + virtual void SetDetailSampleMaxError (const float error) = 0; + + /// Get maximum contour edge length + virtual int GetMaxEdgeLength () const = 0; + /// Set maximum contour edge length + virtual void SetMaxEdgeLength (const int length) = 0; + + /// Get minimum regions size (smaller regions will be deleted) + virtual int GetMinRegionSize () const = 0; + /// Set minimum regions size (smaller regions will be deleted) + virtual void SetMinRegionSize (const int size) = 0; + + /// Get minimum regions size (smaller regions will be merged) + virtual int GetMergeRegionSize () const = 0; + /// Set minimum regions size (smaller regions will be merged) + virtual void SetMergeRegionSize (const int size) = 0; + + /// Get max number of vertices per polygon + virtual int GetMaxVertsPerPoly () const = 0; + /// Set max number of vertices per polygon + virtual void SetMaxVertsPerPoly (const int maxVerts) = 0; + + /// Get tile size (Width and Height of a tile) + virtual int GetTileSize () const = 0; + /// Set tile size (Width and Height of a tile) + virtual void SetTileSize (const int size) = 0; + + /// Get border size + virtual int GetBorderSize () const = 0; + /// Set border size + virtual void SetBorderSize (const int size) = 0; + + /// Set the size of the polygon search bounding box + virtual csVector3 GetPolygonSearchBox () const = 0; + /// Get the size of the polygon search bounding box + virtual void SetPolygonSearchBox (const csVector3 box) = 0; +}; + + + +/** + * Path between two points which lay in the same Sector. + */ +struct iCelNavMeshPath : public virtual iBase +{ + SCF_INTERFACE (iCelNavMeshPath, 1, 0, 0); + + /// Get this path's sector + virtual iSector* GetSector () const = 0; + + /// Get current node from the navigation path + virtual void Current (csVector3& vector) const = 0; + + /// Get next node from the navigation path + virtual void Next (csVector3& vector) = 0; + + /// Get previous node from the navigation path + virtual void Previous (csVector3& vector) = 0; + + /// Get first node from the navigation path + virtual void GetFirst (csVector3& vector) const = 0; + + /// Get last node from the navigation path + virtual void GetLast (csVector3& vector) const = 0; + + /// Check if the navigation mesh has nodes after the current one + virtual bool HasNext () const = 0; + + /// Check if the navigation mesh has nodes before the current one + virtual bool HasPrevious () const = 0; + + /// Invert the navigation path + virtual void Invert () = 0; + + /// Restart the navigation path + virtual void Restart () = 0; + + /// Add a new node at the end of the path + virtual void AddNode (csVector3 node) = 0; + + /// Add a new node in position pos + virtual void InsertNode (int pos, csVector3 node) = 0; + + /// Calculate path length + virtual float Length() const = 0; + + /// Get the number of nodes in this path + virtual int GetNodeCount () const = 0; + + /** + * Render path. + * \remarks The user is responsible for freeing the returned pointer. + */ + virtual csList<csSimpleRenderMesh>* GetDebugMeshes () const = 0; +}; + + + +/** + * Polygon mesh representing the navigable areas of a Sector. + */ +struct iCelNavMesh : public virtual iBase +{ + SCF_INTERFACE (iCelNavMesh, 1, 0, 0); + + /** + * Find the shortest path between two points. + * \param from Origin of the path. + * \param goal Destination of the path. + * \return Pointer to the shortest path between the two points, or 0 in case + * something went wrong. + */ + virtual iCelNavMeshPath* ShortestPath (const csVector3& from, const csVector3& goal, + int maxPathSize = 32) = 0; + + /** + * Update the tiles of the navigation mesh that intersect with an axis aligned bounding box. + * \param boundingBox Bounding box representing the area to be updated. + * \return True in case everything went right and false otherwise. + */ + virtual bool Update (const csBox3& boundingBox) = 0; + + /** + * Update the tiles of the navigation mesh that intersect with an oriented bounding box. + * \param boundingBox Bounding box representing the area to be updated. + * \return True in case everything went right and false otherwise. + */ + virtual bool Update (const csOBB& boundingBox) = 0; + + /// Get navigation mesh sector + virtual iSector* GetSector () const = 0; + + /// Set navigation mesh sector + virtual void SetSector (iSector* sector) = 0; + + /// Get navigation mesh parameters + virtual iCelNavMeshParams* GetParameters () const = 0; + + /// Get navigation mesh bounding box + virtual csBox3 GetBoundingBox() const = 0; + + // obtain a list of polygons overlapping a box + virtual csArray<csPoly3D> QueryPolygons(const csBox3& box) const = 0; + + /// Save to file + virtual bool SaveToFile (iFile* file) const = 0; + + /** + * Render navigation mesh. + * \remarks The user is responsible for freeing the returned pointer. + */ + virtual csList<csSimpleRenderMesh>* GetDebugMeshes () const = 0; + + /** + * Render proxy agent. + * \remarks The user is responsible for freeing the returned pointer. + */ + virtual csList<csSimpleRenderMesh>* GetAgentDebugMeshes (const csVector3& pos) const = 0; + + /** + * Render proxy agent of the specified color. + * \remarks The user is responsible for freeing the returned pointer. + */ + virtual csList<csSimpleRenderMesh>* GetAgentDebugMeshes (const csVector3& pos, int red, int green, + int blue, int alpha) const = 0; +}; + + + +/** + * Navigation mesh creator. + */ +struct iCelNavMeshBuilder : public virtual iBase +{ + SCF_INTERFACE (iCelNavMeshBuilder, 1, 0, 0); + + /** + * Set an iSector as the current working sector and loads it's triangles. + * \param sector Pointer to the new iSector. + * \return True in case everything went right and false otherwise. + * \remarks Even in case of a false return, the old sector information is lost. + * You should call iCelNavMeshBuilder::SetNavMeshParams() before this method. + */ + virtual bool SetSector (iSector* sector) = 0; + + /** + * Build a navigation mesh from the triangles in a Sector, using current configuration. + * \return Pointer to the navigation mesh, or 0 if something went wrong. + * \remarks A valid iSector must have been set using iCelNavMeshBuilder::SetSector() + * before calling this method. + */ + THREADED_INTERFACE(BuildNavMesh); + + /** + * Load a navigation mesh from a file. + * \param file Pointer to file in the virtual filesystem. + * \return Pointer to the navigation mesh, or 0 if something went wrong. + */ + virtual iCelNavMesh* LoadNavMesh (iFile* file) = 0; + + /** + * Get an object representation of the navigation mesh parameters. + * \return Pointer to navigation mesh parameters object. + */ + virtual const iCelNavMeshParams* GetNavMeshParams () const = 0; + + /** + * Set navigation mesh parameters. + * \remarks Should be called before iCelNavMeshBuilder::SetSector(). + */ + virtual void SetNavMeshParams (const iCelNavMeshParams* parameters) = 0; + + virtual iSector* GetSector () const = 0; + +}; + +#endif // __CEL_NAVMESHAPI__ Property changes on: soc/2011/combat/lang/1337 ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/lang/1337:7178-7248 + /trunk/lang/1337:7178-7250 Property changes on: soc/2011/combat/lang/englishtemplate ___________________________________________________________________ Modified: svn:mergeinfo - /personal/Kayden/lang/english:2590-3147 /personal/Xordan/lang/english:1745,1752,1812,1838,1887,1894,2012,2014-2017,2055-2056,2062,2064,2270,2272-2273,2277-2278,2283-2284,2286-2287,2290-2291,2330,2333-2334,2336,2424,2592,2595-2596,2598-2603,2613 /trunk/lang/englishtemplate:7178-7248 + /personal/Kayden/lang/english:2590-3147 /personal/Xordan/lang/english:1745,1752,1812,1838,1887,1894,2012,2014-2017,2055-2056,2062,2064,2270,2272-2273,2277-2278,2283-2284,2286-2287,2290-2291,2330,2333-2334,2336,2424,2592,2595-2596,2598-2603,2613 /trunk/lang/englishtemplate:7178-7250 Property changes on: soc/2011/combat/lang/french ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/lang/french:7178-7248 + /trunk/lang/french:7178-7250 Property changes on: soc/2011/combat/lang/italian ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/lang/italian:7178-7248 + /trunk/lang/italian:7178-7250 Property changes on: soc/2011/combat/src/tools/ccheck ___________________________________________________________________ Modified: svn:mergeinfo - /trunk/src/tools/ccheck:7178-7248 /trunk/src/tools/fparser/src/tools/ccheck:4840 + /trunk/src/tools/ccheck:7178-7250 /trunk/src/tools/fparser/src/tools/ccheck:4840 Deleted: soc/2011/combat/src/tools/fparser/docs/fparser.html =================================================================== --- trunk/src/tools/fparser/docs/fparser.html 2011-05-12 04:41:41 UTC (rev 7250) +++ soc/2011/combat/src/tools/fparser/docs/fparser.html 2011-05-12 18:55:31 UTC (rev 7251) @@ -1,1728 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> -<html> -<head> - <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> - <link href="style.css" rel="stylesheet" type="text/css" title="normal" media=screen> - <title>Function Parser for C++ v4.4.2 : Documentation</title> -</head> - -<body> -<h1>Function Parser for C++ v4.4.2 </h1> - -<p>Authors: Juha Nieminen -(<a href="http://iki.fi/warp/">http://iki.fi/warp/</a>), -Joel Yliluoma -(<a href="http://iki.fi/bisqwit/">http://iki.fi/bisqwit/</a>). - -<p>The usage license of this library is located at the end of this file. - -<h2>Table of contents:</h2> - -<ul> - <li><a href="#whatsnew">What's new</a> - <li><a href="#preface">Preface</a> - <li><a href="#usage">Usage</a> - <ul> - <li><a href="#parsertypes">Parser types</a> - <li><a href="#configuring">Configuring the compilation</a> - <li><a href="#copyassignment">Copying and assignment</a> - <li><a href="#shortdesc">Short descriptions of FunctionParser methods</a> - <li><a href="#longdesc">Long descriptions of FunctionParser methods</a> - <ul> - <li><a href="#longdesc_Parse"><code>Parse()</code></a> - <li><a href="#longdesc_setDelimiterChar"><code>setDelimiterChar()</code></a> - <li><a href="#longdesc_ErrorMsg"><code>ErrorMsg()</code></a> - <li><a href="#longdesc_GetParseErrorType"><code>GetParseErrorType()</code></a> - <li><a href="#longdesc_Eval"><code>Eval()</code></a> - <li><a href="#longdesc_EvalError"><code>EvalError()</code></a> - <li><a href="#longdesc_Optimize"><code>Optimize()</code></a> - <li><a href="#longdesc_AddConstant"><code>AddConstant()</code></a> - <li><a href="#longdesc_AddUnit"><code>AddUnit()</code></a> - <li><a href="#longdesc_AddFunction1"><code>AddFunction()</code></a> (C++ function) - <li><a href="#longdesc_AddFunction2"><code>AddFunction()</code></a> (FunctionParser) - <li><a href="#longdesc_RemoveIdentifier"><code>RemoveIdentifier()</code></a> - <li><a href="#longdesc_ParseAndDeduceVariables"><code>ParseAndDeduceVariables()</code></a> - </ul> - </ul> - <li>Syntax - <ul> - <li><a href="#literals">Numeric literals</a> - <li><a href="#identifiers">Identifier names</a> - <li><a href="#functionsyntax">The function string syntax</a> - <li><a href="#inlinevars">Inline variables</a> - <li><a href="#whitespace">Whitespace</a> - </ul> - <li>Miscellaneous - <ul> - <li><a href="#fpaccuracy">About floating point accuracy</a> - <li><a href="#evaluationchecks">About evaluation-time checks</a> - <li><a href="#threadsafety">About thread safety</a> - <li><a href="#tipsandtricks">Tips and tricks</a> - <li><a href="#contact">Contacting the author</a> - </ul> -<!-- <li><a href="#algorithm">The algorithm used in the library</a> --> - <li><a href="#license">Usage license</a> -</ul> - -<a name="whatsnew"></a> -<h2>What's new</h2> - -<p>What's new in v4.4.2 - <ul> - <li>Complex-only internal functions were being not properly disabled in the - non-complex versions of the parser, causing mayhem if they were called - from those. - </ul> - -<p>What's new in v4.4.1 - <ul> - <li>Added missing documentation on complex literals. - <li>Fixed pro... [truncated message content] |