亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? navigate.h

?? this keik game source
?? H
?? 第 1 頁 / 共 2 頁
字號:
//-----------------------------------------------------------------------------
//
//  $Logfile:: /Quake 2 Engine/Sin/code/game/navigate.h                       $
// $Revision:: 42                                                             $
//   $Author:: Markd                                                          $
//     $Date:: 11/18/98 7:47p                                                 $
//
// Copyright (C) 1998 by Ritual Entertainment, Inc.
// All rights reserved.
//
// This source may not be distributed and/or modified without
// expressly written permission by Ritual Entertainment, Inc.
//
// $Log:: /Quake 2 Engine/Sin/code/game/navigate.h                            $
// 
// 42    11/18/98 7:47p Markd
// Allowed nearestnode to ignore entity bbox
// 
// 41    11/08/98 6:34p Jimdose
// added SetNodeFlagsEvent
// 
// 40    10/26/98 6:32p Jimdose
// added fulltest to CheckPath and ClearPathTo
// 
// 39    10/26/98 5:16p Jimdose
// Added CalcPath and DisconnectPath
// 
// 38    10/26/98 4:42p Jimdose
// added recalcpaths
// 
// 37    10/25/98 11:53p Jimdose
// added EXPORT_TEMPLATE
// 
// 36    10/18/98 3:22a Jimdose
// Added code for timing paths
// 
// 35    10/14/98 10:59p Jimdose
// map name is now passed into Init
// 
// 34    10/14/98 5:22p Markd
// Changed jumptarget to target
// 
// 33    9/22/98 12:49p Markd
// Put in archive and unarchive functions
// 
// 32    9/18/98 10:59p Jimdose
// Started on swimming actors
// 
// 31    9/14/98 5:40p Jimdose
// NearestNode now requires that you pass in the entity that is going to use
// the path.
// NearestNode no longer hard codes the size when testing moves
// Added ai_shownodenums
// Revamped tests for valid paths.  Actors get stuck much less often.
// Made DrawAllConnections more usefull.
// ClearPathTo now uses binary search for finding the max height of a path.
// Upped version number
// Added FindEntities to fixup door entity numbers when loading pathfiles
// Fixed definition of MAX_WIDTH (it was still multiplied by 2 from the way it
// used to work).
// 
// 30    9/08/98 9:51p Jimdose
// Changed NUM_PATHSPERNODE and NUM_WIDTH_VALUES
// Made CHECK_PATH use a granularity of 8 instead of 16
// 
// 29    9/03/98 9:12p Jimdose
// made paths aware of doors
// 
// 28    8/29/98 9:53p Jimdose
// moved prototype of SV_TestMovestep to g_phys.h
// 
// 27    8/24/98 6:58p Jimdose
// Added array of heights for each width that a path supports
// 
// 26    8/19/98 7:59p Jimdose
// Began adding support for ladder and jump nodes
// 
// 25    8/18/98 10:03p Jimdose
// Separated checks for connection from checks for near nodes so that non-door
// nodes will not connect to nodes through doors
// 
// 24    8/15/98 5:32p Jimdose
// Increased MAX_PATHNODES
// 
// 23    7/26/98 6:42a Jimdose
// Added entnum to pathnode
// 
// 22    7/26/98 5:37a Jimdose
// added occupiedTime
// 
// 21    7/26/98 2:41a Jimdose
// Path files moved to maps directory
// Path files now contain full connection information to improve load times
// 
// 20    7/25/98 2:10a Jimdose
// Preparing for door nodes
// 
// 19    7/17/98 8:34p Jimdose
// Fixed bug where CreatePath would overwrite the stack if the path was longer
// than MAX_PATH_LENGTH
// 
// 18    6/13/98 8:21p Jimdose
// Moved search algorithm to separate object - PathFinder
// Removed optimize path stuff
// Added maxwidth and maxheight to paths
// 
// 17    6/09/98 5:32p Jimdose
// added ai_maxnode
// 
// 16    5/27/98 5:11a Jimdose
// working on ai
// 
// 15    5/25/98 5:31p Jimdose
// Pathnodes are no longer a subclass of Entity.  This was done to save on
// edicts
// 
// 14    5/22/98 9:40p Jimdose
// Made paths check through Movers
// 
// 13    5/18/98 8:14p Jimdose
// Renamed Navigator back to PathManager
// 
// 12    5/14/98 10:26p Jimdose
// Added UpdateNode
// Made alot of info in PathNode private
// 
// 11    5/13/98 4:50p Jimdose
// Added use of SafePtrs
// 
// 10    5/09/98 8:04p Jimdose
// added path saving and loading
// PathSearch now a Listener instead of a Class object
// 
// 9     5/07/98 10:43p Jimdose
// added archiving
// 
// 8     4/29/98 5:39p Jimdose
// added ai_checkroutes
// 
// 7     4/27/98 5:27p Jimdose
// working on ai
// 
// 6     4/20/98 2:45p Jimdose
// working on ai
// 
// 5     4/18/98 3:02p Jimdose
// Added ai_createnodes and ai_showpath	
// working on ai
// 
// 4     4/16/98 2:10p Jimdose
// Major rewrite
// 
// 3     3/02/98 8:49p Jimdose
// Changed CLASS_PROTOTYPE to only take the classname
// 
// 2     3/02/98 5:44p Jimdose
// Continued development.  Now use Path class to represent finished paths.
// 
// 1     2/25/98 2:27p Jimdose
// 
// 8     2/21/98 1:07p Jimdose
// Updated for Q2 dlls
// 
// 6     12/06/97 6:32p Jimdose
// Further evolution on path code.
// 
// 5     11/12/97 2:11p Jimdose
// Simplified the interface to PathSearch
// 
// 4     11/07/97 6:39p Jimdose
// More work on integrating with Sin
// 
// 3     11/05/97 4:00p Jimdose
// More work converting to work with Sin.
// 
// 2     9/26/97 6:14p Jimdose
// Added standard Ritual headers
//
// DESCRIPTION:
// Potentially could be an C++ implementation of the A* search algorithm, but
// is currently unfinished.
// 

#ifndef __NAVIGATE_H__
#define __NAVIGATE_H__

#include "g_local.h"
#include "class.h"
#include "entity.h"
#include "stack.h"
#include "container.h"
#include "doors.h"

extern Event EV_AI_SavePaths;
extern Event EV_AI_SaveNodes;
extern Event EV_AI_LoadNodes;
extern Event EV_AI_ClearNodes;
extern Event EV_AI_RecalcPaths;
extern Event EV_AI_CalcPath;
extern Event EV_AI_DisconnectPath;

extern cvar_t	*ai_createnodes;
extern cvar_t	*ai_showpath;
extern cvar_t	*ai_shownodes;
extern cvar_t	*ai_debugpath;
extern cvar_t	*ai_debuginfo;
extern cvar_t	*ai_showroutes;
extern cvar_t  *ai_timepaths;

extern int		ai_maxnode;

#define MAX_PATHCHECKSPERFRAME 4

extern int path_checksthisframe;

#define MAX_PATH_LENGTH		128		// should be more than plenty
#define NUM_PATHSPERNODE	16

class Path;
class PathNode;

#define NUM_WIDTH_VALUES	16
#define WIDTH_STEP			8
#define MAX_WIDTH				( WIDTH_STEP * NUM_WIDTH_VALUES )
#define MAX_HEIGHT			128

#define CHECK_PATH( path, width, height ) \
	( ( ( ( width ) >= MAX_WIDTH ) || ( ( width ) < 0 ) ) ? false : \
	( ( int )( path )->maxheight[ ( ( width ) / WIDTH_STEP ) - 1 ] < ( int )( height ) ) )

typedef struct
	{
	short			node;
	short			moveCost;
	byte			maxheight[ NUM_WIDTH_VALUES ];
	int			door;
	} pathway_t;

typedef enum { NOT_IN_LIST, IN_OPEN, IN_CLOSED } pathlist_t;

#define AI_FLEE		1
#define AI_DUCK		2
#define AI_COVER		4
#define AI_DOOR		8
#define AI_JUMP		16
#define AI_LADDER		32
#define AI_ACTION    64

void EXPORT_FROM_DLL DrawAllConnections( void );

class EXPORT_FROM_DLL PathNode : public Listener
	{
	public:
		PathNode			*chain;
		pathway_t		Child[ NUM_PATHSPERNODE ];	// these are the real connections between nodex
		int				numChildren;

		// These variables are all used during the search
		int				f;
		int				h;
		int				g;

		int				gridX;
		int				gridY;

		float				drawtime;
		float				occupiedTime;
		int				entnum;

		pathlist_t		inlist;
	
		// reject is used to indicate that a node is unfit for ending on during a search
		qboolean			reject;

		PathNode			*Parent;

		// For the open and closed lists
		PathNode			*NextNode;

		int				nodeflags;

		friend class   PathSearch;
		friend void		DrawAllConnections( void );

	private :
      qboolean       TestMove( Entity *ent, Vector start, Vector end, Vector &min, Vector &max, qboolean allowdoors = false, qboolean fulltest = false );

		qboolean			ConnectedTo( PathNode *node );
		void				ConnectTo( PathNode *node, byte maxheight[ NUM_WIDTH_VALUES ], float cost, Door *door = NULL );
		void				ConnectTo( PathNode *node, byte maxheight[ NUM_WIDTH_VALUES ] );
		void				Disconnect( PathNode *node );

		void				FindChildren( Event *ev );
      void           FindEntities( Event *ev );

	public:
      CLASS_PROTOTYPE( PathNode );

      int            contents;
		Vector			worldorigin;
		Vector			worldangles;
		Vector			mins;
		Vector			maxs;
		str				targetname;
		str				target;

		int				nodenum;

		qboolean			setangles;
		str				animname;

							PathNode();
							~PathNode();
		
		void				Setup( Vector pos );
		void				setAngles( Vector ang );
		void				setOrigin( Vector org );
		void				setSize( Vector min, Vector max );
		str				&TargetName( void );
		virtual void	Archive( Archiver &arc );
		virtual void	Unarchive( Archiver &arc );
		
		qboolean			CheckPath( PathNode *node, Vector min, Vector max, qboolean fulltest = true );
		Door				*CheckDoor( Vector pos );

      qboolean       CheckMove( Entity *ent, Vector pos, Vector &min, Vector &max, qboolean allowdoors = false, qboolean fulltest = false );
		qboolean			CheckMove( Vector pos, Vector min, Vector max );
		qboolean			ClearPathTo( PathNode *node, byte maxheight[ NUM_WIDTH_VALUES ], qboolean fulltest = true );
		qboolean			LadderTo( PathNode *node, byte maxheight[ NUM_WIDTH_VALUES ] );
		void				DrawConnections( void );
	};

//
// Exported templated classes must be explicitly instantiated
//
#ifdef EXPORT_TEMPLATE
template class EXPORT_FROM_DLL Stack<PathNode *>;
template class EXPORT_FROM_DLL SafePtr<PathNode>;
#endif
typedef SafePtr<PathNode> PathNodePtr;

#define PATHMAP_GRIDSIZE	32
#define PATHMAP_CELLSIZE	( 8192 / PATHMAP_GRIDSIZE )

#define PATHMAP_NODES		126			// 128 - sizeof( int ) / sizeof( short )

class EXPORT_FROM_DLL MapCell
	{
	private :
		int	numnodes;
		short	nodes[ PATHMAP_NODES ];

	public :
								MapCell();
								~MapCell();
		void					Init( void );
		qboolean				AddNode( PathNode *node );
		qboolean				RemoveNode( PathNode *node );
		PathNode				*GetNode( int index );
		int					NumNodes( void );
	};

class EXPORT_FROM_DLL PathSearch : public Listener
	{
	private:
		MapCell				PathMap[ PATHMAP_GRIDSIZE ][ PATHMAP_GRIDSIZE ];

		void					AddToGrid( PathNode *node, int x, int y );
		qboolean				RemoveFromGrid( PathNode *node, int x, int y );
		int					NodeCoordinate( float coord );
		int					GridCoordinate( float coord );
		void					ClearNodes( Event *ev );
		void					LoadNodes( Event *ev );
		void					SaveNodes( Event *ev );
		void					SavePathsEvent( Event *ev );
      void              SetNodeFlagsEvent( Event *ev );
		void					RecalcPathsEvent( Event *ev );
      void              CalcPathEvent( Event *ev );
      void              DisconnectPathEvent( Event *ev );

	public:
      CLASS_PROTOTYPE( PathSearch );

		void					Archive( Archiver &arc );
		void					Unarchive( Archiver &arc );
		void					AddNode( PathNode *node );
		void					RemoveNode( PathNode *node );
		void					UpdateNode( PathNode *node );
		MapCell				*GetNodesInCell( int x, int y );
		MapCell				*GetNodesInCell( Vector pos );
		PathNode				*NearestNode( Vector pos, Entity *ent = NULL, qboolean usebbox = true );
		void					Teleport( Entity *teleportee, Vector from, Vector to );
		void					ShowNodes( void );
		int					NumNodes( void );
		void					SavePaths( void );
		void					Init( const char *mapname );
	};

extern PathSearch PathManager;

#define MAX_PATHNODES 2048

PathNode *AI_FindNode( const char *name );
PathNode *AI_GetNode( int num );
void AI_AddNode( PathNode *node );
void AI_RemoveNode( PathNode *node );
void AI_ResetNodes( void );

#include "path.h"

template<class Heuristic>
class EXPORT_FROM_DLL PathFinder
	{
	private:
	   Stack<PathNode *>	stack;
	   PathNode				*OPEN;
	   PathNode				*CLOSED;
		PathNode				*endnode;

		void					ClearPath( void );
		void					ClearOPEN( void );
		void					ClearCLOSED( void );
		PathNode				*ReturnBestNode( void );
		void					GenerateSuccessors( PathNode *BestNode );
		void					Insert( PathNode *Successor );
		void					PropagateDown( PathNode *Old );
		Path					*CreatePath( PathNode *startnode );

	public:
		Heuristic			heuristic;

								PathFinder();
								~PathFinder<Heuristic>();
		Path					*FindPath( PathNode *from, PathNode *to );
		Path					*FindPath( Vector start, Vector end );
	};

template <class Heuristic>
PathFinder<Heuristic>::PathFinder()
	{
	OPEN   = NULL;
	CLOSED = NULL;
	}

template <class Heuristic>
PathFinder<Heuristic>::~PathFinder()
	{
	ClearPath();
	}

template <class Heuristic>
EXPORT_FROM_DLL void PathFinder<Heuristic>::ClearOPEN
	(
	void
	)

	{
	PathNode *node;

	while( OPEN )
		{
		node = OPEN;
		OPEN = node->NextNode;

		node->inlist = NOT_IN_LIST;
		node->NextNode = NULL;
		node->Parent = NULL;

		// reject is used to indicate that a node is unfit for ending on during a search
		node->reject = false;
		}
	}

template <class Heuristic>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久日韩粉嫩一区二区三区| 亚洲欧美日韩人成在线播放| 日韩精品自拍偷拍| 色哟哟在线观看一区二区三区| 欧美酷刑日本凌虐凌虐| 久久久久久免费| 亚洲精品福利视频网站| 日本成人在线电影网| 欧美中文字幕一区二区三区| 亚洲麻豆国产自偷在线| 国产精品日韩精品欧美在线| 国产精品网站在线观看| 国产精品超碰97尤物18| 亚洲人吸女人奶水| 一片黄亚洲嫩模| 国内不卡的二区三区中文字幕| 国产91在线观看| 678五月天丁香亚洲综合网| 国产精品女同一区二区三区| 日本不卡不码高清免费观看| 国产v日产∨综合v精品视频| 日韩一级视频免费观看在线| 一区二区在线观看免费| 91影院在线免费观看| 精品在线免费观看| av电影在线观看完整版一区二区| 国产精品私房写真福利视频| 91麻豆6部合集magnet| 亚洲三级在线免费观看| 国产美女视频一区| 精品国免费一区二区三区| 免费在线观看一区二区三区| caoporen国产精品视频| 欧美va亚洲va在线观看蝴蝶网| 亚洲大型综合色站| 欧美人牲a欧美精品| 午夜精品福利一区二区三区av | 亚洲午夜精品17c| 91精品国产综合久久蜜臀| 成人a区在线观看| 麻豆成人av在线| 免费不卡在线视频| 亚洲在线免费播放| 欧美激情一区二区三区全黄| 精品日韩一区二区三区免费视频| 色综合久久66| 91蜜桃免费观看视频| 国产成人综合网| 日韩精品一区第一页| 欧美成人性战久久| 欧美在线|欧美| 韩国精品一区二区| 亚洲图片你懂的| 日韩精品一区二区三区在线观看| 成人小视频在线观看| 午夜亚洲福利老司机| 国产欧美精品区一区二区三区| 91美女蜜桃在线| 国产成人精品一区二| 中文字幕在线免费不卡| 国产精品―色哟哟| 国产精品久久久久久久久晋中 | 国产成人av福利| 亚洲三级免费电影| 日本一区二区三区电影| 欧美视频你懂的| av在线综合网| 成人精品一区二区三区四区| 精品在线播放午夜| 蜜芽一区二区三区| 日欧美一区二区| 亚洲国产wwwccc36天堂| 亚洲精品久久久蜜桃| 国产精品久久久久天堂| 久久先锋影音av| 日韩欧美亚洲国产另类| 欧美日韩极品在线观看一区| 色天天综合色天天久久| aa级大片欧美| 色乱码一区二区三区88| 色综合久久中文字幕综合网| 91视频在线观看免费| 日本福利一区二区| 精品视频一区 二区 三区| 黄网站免费久久| 成人一道本在线| 色域天天综合网| 3751色影院一区二区三区| 欧美精品色一区二区三区| 欧美一级高清片| 欧美www视频| 国产精品久久久久aaaa| 亚洲日穴在线视频| 视频一区中文字幕国产| 国产mv日韩mv欧美| 91成人在线精品| 精品免费视频一区二区| 国产精品久久久久aaaa樱花| 一级特黄大欧美久久久| 久久精品免费观看| 91在线一区二区| 欧美xxxx在线观看| 亚洲精品视频在线观看免费| 美女网站一区二区| 在线观看区一区二| 国产欧美日韩不卡免费| 亚洲国产视频在线| 国产乱色国产精品免费视频| 欧美在线观看视频一区二区三区| 久久综合久久鬼色| 日本欧美大码aⅴ在线播放| 成人av免费在线| 久久精品夜夜夜夜久久| 奇米影视7777精品一区二区| 在线精品视频免费播放| 国产精品色哟哟网站| 国产精品一级片在线观看| 欧洲精品中文字幕| 国产精品黄色在线观看| 成人中文字幕在线| 欧美精彩视频一区二区三区| 蜜乳av一区二区| 精品理论电影在线| 精品一区二区三区免费播放| 精品日韩欧美一区二区| 国产一区二区在线观看视频| 精品剧情v国产在线观看在线| 国产最新精品免费| 国产日韩欧美麻豆| 国产·精品毛片| 久久先锋影音av鲁色资源| 日本欧美久久久久免费播放网| 国产日产欧美一区| 成人综合婷婷国产精品久久蜜臀 | 欧美色综合网站| 91麻豆精品国产91久久久久| 亚洲视频你懂的| 麻豆精品一二三| 日韩免费观看2025年上映的电影| 蜜臀精品久久久久久蜜臀| 综合欧美亚洲日本| 性欧美疯狂xxxxbbbb| 久久99精品久久久| 波多野结衣亚洲| 欧美一区二区三区的| 国产精品天干天干在观线| 中文字幕巨乱亚洲| 日韩欧美在线影院| av亚洲产国偷v产偷v自拍| 欧美日韩国产小视频| 日韩久久精品一区| 三级亚洲高清视频| 欧美三日本三级三级在线播放| 亚洲黄色尤物视频| 日韩免费成人网| 国内精品久久久久影院色| 欧美成人女星排行榜| 亚洲欧美日韩在线不卡| 色婷婷精品久久二区二区蜜臀av| 石原莉奈在线亚洲三区| 91精品国产麻豆国产自产在线 | 欧美午夜寂寞影院| 国产精品18久久久久久久久| 国产精品久久久久久久久快鸭 | 日韩美女精品在线| 4438x成人网最大色成网站| 欧美日韩中文字幕精品| 国产精品系列在线观看| 久久av中文字幕片| 亚洲人成网站影音先锋播放| 国产精品久久午夜| 天天色 色综合| 喷水一区二区三区| 青青青爽久久午夜综合久久午夜| 伊人婷婷欧美激情| 亚洲天堂av一区| 日韩国产在线观看| 国产精品77777| 国产乱理伦片在线观看夜一区| 国产成人自拍在线| 成人免费视频视频| 色噜噜夜夜夜综合网| 日韩欧美三级在线| 最新国产成人在线观看| 国产精品蜜臀在线观看| 久久福利资源站| 欧美日韩不卡在线| 一区二区三区四区精品在线视频| 另类人妖一区二区av| 51精品秘密在线观看| 久久久www成人免费无遮挡大片| 亚洲精品一区二区三区影院| 欧美精品一区二区高清在线观看| 日韩天堂在线观看| ...xxx性欧美| 久久国产精品色| 色狠狠一区二区| 日本一区二区三级电影在线观看| 亚洲一区二区欧美激情| 国产成人精品亚洲午夜麻豆|