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

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

?? navigationcell.h

?? 一個人工智能方面的小程序,用OPENGL和VC++做到,希望對大家有所啟發
?? H
字號:
/* Copyright (C) Greg Snook, 2000.  * All rights reserved worldwide. * * This software is provided "as is" without express or implied * warranties. You may freely copy and compile this source into * applications you distribute provided that the copyright text * below is included in the resulting source code, for example: * "Portions Copyright (C) Greg Snook, 2000" */#ifndef NAVIGATIONCELL_H#define NAVIGATIONCELL_H/****************************************************************************************\	NavigationCell.h	NavigationCell component interface for the Navimesh sample program.	Included as part of the Game Programming Gems sample code.	Created 3/18/00 by Greg Snook	greg@mightystudios.com    ------------------------------------------------------------------------------------- 	Notes/Revisions:\****************************************************************************************/#ifndef _MTXLIB_H#include "mtxlib.h"#endif#ifndef PLANE_H#include "plane.h"#endif#ifndef LINE2D_H#include "line2d.h"#endif// a forward declaration for NavigationHeap is requiredclass NavigationHeap;/*	NavigationCell------------------------------------------------------------------------------------------		A NavigationCell represents a single triangle within a NavigationMesh. It contains 	functions for testing a path against the cell, and various ways to resolve collisions	with the cell walls. Portions of the A* path finding algorythm are provided within this	class as well, but the path finding process is managed by the parent Navigation Mesh.	------------------------------------------------------------------------------------------*/class NavigationCell{public:	// ----- ENUMERATIONS & CONSTANTS -----	enum CELL_VERT	{		VERT_A = 0,		VERT_B,		VERT_C	};	enum CELL_SIDE	{		SIDE_AB = 0,		SIDE_BC,		SIDE_CA	};	enum PATH_RESULT	{		NO_RELATIONSHIP,		// the path does not cross this cell		ENDING_CELL,			// the path ends in this cell			EXITING_CELL,			// the path exits this cell through side X	};	// ----- CREATORS ---------------------	inline NavigationCell():m_SessionID(0){};	inline NavigationCell( const NavigationCell& Src){*this = Src;};	inline ~NavigationCell(){};	// ----- OPERATORS --------------------	NavigationCell& operator=( const NavigationCell& Src);	// ----- MUTATORS ---------------------	void Initialize(const vector3& PointA, const vector3& PointB, const vector3& PointC);	void ComputeCellData();	bool RequestLink(const vector3& PointA, const vector3& PointB, NavigationCell* Caller);	void SetLink(CELL_SIDE Side, NavigationCell* Caller);	PATH_RESULT ClassifyPathToCell(const Line2D& MotionPath, NavigationCell** pNextCell, CELL_SIDE& Side, vector2* pPointOfIntersection)const;	void ProjectPathOnCellWall(CELL_SIDE SideNumber, Line2D& MotionPath)const;	void MapVectorHeightToCell(vector3& MotionPoint)const;	bool ForcePointToCellCollumn(vector3& TestPoint)const;	bool ForcePointToCellCollumn(vector2& TestPoint)const;	bool ForcePointToWallInterior(CELL_SIDE SideNumber, vector2& TestPoint)const;	bool ForcePointToWallInterior(CELL_SIDE SideNumber, vector3& TestPoint)const;	bool ProcessCell(NavigationHeap* pHeap);	bool QueryForPath(NavigationHeap* pHeap, NavigationCell* Caller, float arrivalcost);	// ----- ACCESSORS --------------------	bool IsPointInCellCollumn(const vector3& TestPoint)const;	bool IsPointInCellCollumn(const vector2& TestPoint)const;	const vector3& Vertex(int Vert)const;	const vector3& CenterPoint()const;	NavigationCell* Link(int Side)const;	const vector3& LinkPoint()const;	float ArrivalCost()const;	float Heuristic()const;	float PathfindingCost()const;	int ArrivalWall()const;	const vector3 WallMidpoint(int Side)const;private:	// ----- DATA -------------------------	Plane	m_CellPlane;		// A plane containing the cell triangle	vector3 m_Vertex[3];		// pointers to the verticies of this triangle held in the NavigationMesh's vertex pool	vector3 m_CenterPoint;		// The center of the triangle	Line2D	m_Side[3];			// a 2D line representing each cell Side	NavigationCell* m_Link[3];// pointers to cells that attach to this cell. A NULL link denotes a solid edge.	// Pathfinding Data...	int		m_SessionID;		// an identifier for the current pathfinding session.	float	m_ArrivalCost;		// total cost to use this cell as part of a path	float	m_Heuristic;		// our estimated cost to the goal from here	bool	m_Open;				// are we currently listed as an Open cell to revisit and test?	int		m_ArrivalWall;		// the side we arrived through.	vector3 m_WallMidpoint[3];	// the pre-computed midpoint of each wall.	float	m_WallDistance[3];	// the distances between each wall midpoint of sides (0-1, 1-2, 2-0)  	// ----- HELPER FUNCTIONS -------------	void ComputeHeuristic(const vector3& Goal); // estimates the distance to the goal for A*	// ----- UNIMPLEMENTED FUNCTIONS ------};//- Inline Functions ---------------------------------------------------------------------//= CREATORS =============================================================================//= OPERATORS ============================================================================inline NavigationCell& NavigationCell::operator=( const NavigationCell& Src){	if (this != &Src)	{		m_CellPlane = Src.m_CellPlane;				m_CenterPoint = Src.m_CenterPoint;			m_SessionID= Src.m_SessionID;		m_ArrivalCost= Src.m_ArrivalCost;		m_Heuristic= Src.m_Heuristic;		m_Open= Src.m_Open;		m_ArrivalWall= Src.m_ArrivalWall;		for (int i=0;i<3;i++)		{			m_Vertex[i] = Src.m_Vertex[i];			m_Side[i] = Src.m_Side[i];			m_Link[i] = Src.m_Link[i];			m_WallMidpoint[i] = Src.m_WallMidpoint[i];			m_WallDistance[i] = Src.m_WallDistance[i];		}	}	return (*this);}//= MUTATORS =============================================================================//:	Initialize//----------------------------------------------------------------------------------------////	Initialize our Cell object, given it's vertices in clockwise order ////-------------------------------------------------------------------------------------://inline void NavigationCell::Initialize(const vector3& PointA, const vector3& PointB, const vector3& PointC){	m_Vertex[VERT_A] = PointA;	m_Vertex[VERT_B] = PointB;	m_Vertex[VERT_C] = PointC;	// object must be re-linked	m_Link[SIDE_AB] = 0;	m_Link[SIDE_BC] = 0;	m_Link[SIDE_CA] = 0;	// now that the vertex pointers are set, compute additional data about the Cell	ComputeCellData();}//:	ComputeCellData//----------------------------------------------------------------------------------------////	Compute additional data about the cell used for navigation tests and pathfinding ////-------------------------------------------------------------------------------------://inline void NavigationCell::ComputeCellData(){	// create 2D versions of our verticies	vector2 Point1(m_Vertex[VERT_A].x,m_Vertex[VERT_A].z);	vector2 Point2(m_Vertex[VERT_B].x,m_Vertex[VERT_B].z);	vector2 Point3(m_Vertex[VERT_C].x,m_Vertex[VERT_C].z);	// innitialize our sides	m_Side[SIDE_AB].SetPoints(Point1,Point2);	// line AB	m_Side[SIDE_BC].SetPoints(Point2,Point3);	// line BC	m_Side[SIDE_CA].SetPoints(Point3,Point1);	// line CA	m_CellPlane.Set(m_Vertex[VERT_A],m_Vertex[VERT_B],m_Vertex[VERT_C]);	// compute midpoint as centroid of polygon	m_CenterPoint.x=((m_Vertex[VERT_A].x + m_Vertex[VERT_B].x + m_Vertex[VERT_C].x)/3);	m_CenterPoint.y=((m_Vertex[VERT_A].y + m_Vertex[VERT_B].y + m_Vertex[VERT_C].y)/3);	m_CenterPoint.z=((m_Vertex[VERT_A].z + m_Vertex[VERT_B].z + m_Vertex[VERT_C].z)/3);	// compute the midpoint of each cell wall	m_WallMidpoint[0].x = (m_Vertex[VERT_A].x + m_Vertex[VERT_B].x)/2.0f;	m_WallMidpoint[0].y = (m_Vertex[VERT_A].y + m_Vertex[VERT_B].y)/2.0f;	m_WallMidpoint[0].z = (m_Vertex[VERT_A].z + m_Vertex[VERT_B].z)/2.0f;	m_WallMidpoint[1].x = (m_Vertex[VERT_C].x + m_Vertex[VERT_B].x)/2.0f;	m_WallMidpoint[1].y = (m_Vertex[VERT_C].y + m_Vertex[VERT_B].y)/2.0f;	m_WallMidpoint[1].z = (m_Vertex[VERT_C].z + m_Vertex[VERT_B].z)/2.0f;	m_WallMidpoint[2].x = (m_Vertex[VERT_C].x + m_Vertex[VERT_A].x)/2.0f;	m_WallMidpoint[2].y = (m_Vertex[VERT_C].y + m_Vertex[VERT_A].y)/2.0f;	m_WallMidpoint[2].z = (m_Vertex[VERT_C].z + m_Vertex[VERT_A].z)/2.0f;	// compute the distances between the wall midpoints	vector3 WallVector;	WallVector = m_WallMidpoint[0] - m_WallMidpoint[1];	m_WallDistance[0] = WallVector.length();	WallVector = m_WallMidpoint[1] - m_WallMidpoint[2];	m_WallDistance[1] = WallVector.length();	WallVector = m_WallMidpoint[2] - m_WallMidpoint[0];	m_WallDistance[2] = WallVector.length();}//:	RequestLink//----------------------------------------------------------------------------------------////	Navigation Mesh is created as a pool of raw cells. The cells are then compared against //	each other to find common edges and create links. This routine is called from a //	potentially adjacent cell to test if a link should exist between the two. ////-------------------------------------------------------------------------------------://inline bool NavigationCell::RequestLink(const vector3& PointA, const vector3& PointB, NavigationCell* Caller){	// return true if we share the two provided verticies with the calling cell.	if (m_Vertex[VERT_A] == PointA)	{		if (m_Vertex[VERT_B] == PointB)		{			m_Link[SIDE_AB] = Caller;			return (true);		}		else if (m_Vertex[VERT_C] == PointB)		{			m_Link[SIDE_CA] = Caller;			return (true);		}	}	else if (m_Vertex[VERT_B] == PointA)	{		if (m_Vertex[VERT_A] == PointB)		{			m_Link[SIDE_AB] = Caller;			return (true);		}		else if (m_Vertex[VERT_C] == PointB)		{			m_Link[SIDE_BC] = Caller;			return (true);		}	}	else if (m_Vertex[VERT_C] == PointA)	{		if (m_Vertex[VERT_A] == PointB)		{			m_Link[SIDE_CA] = Caller;			return (true);		}		else if (m_Vertex[VERT_B] == PointB)		{			m_Link[SIDE_BC] = Caller;			return (true);		}	}	// we are not adjacent to the calling cell	return (false);}//:	SetLink//----------------------------------------------------------------------------------------////	Sets a link to the calling cell on the enumerated edge. ////-------------------------------------------------------------------------------------://inline void NavigationCell::SetLink(CELL_SIDE Side, NavigationCell* Caller){	m_Link[Side] = Caller;}//:	MapVectorHeightToCell//----------------------------------------------------------------------------------------////	Uses the X and Z information of the vector to calculate Y on the cell plane ////-------------------------------------------------------------------------------------://inline void NavigationCell::MapVectorHeightToCell(vector3& MotionPoint)const{	MotionPoint.y= m_CellPlane.SolveForY(MotionPoint.x, MotionPoint.z);}//= ACCESSORS ============================================================================//:	IsPointInCellCollumn//----------------------------------------------------------------------------------------////	Test to see if a 2D point is within the cell. There are probably better ways to do //	this, but this seems plenty fast for the time being. ////-------------------------------------------------------------------------------------://inline bool NavigationCell::IsPointInCellCollumn(const vector2& TestPoint) const{	// we are "in" the cell if we are on the right hand side of all edge lines of the cell	int InteriorCount = 0;	for (int i=0;i<3;i++)	{		Line2D::POINT_CLASSIFICATION SideResult = m_Side[i].ClassifyPoint(TestPoint);		if (SideResult != Line2D::LEFT_SIDE)		{			InteriorCount++;		}	}	return (InteriorCount == 3);}//:	IsPointInCellCollumn//----------------------------------------------------------------------------------------////	Test to see if a 3D point is within the cell by projecting it down to 2D and calling //	the above method. ////-------------------------------------------------------------------------------------://inline bool NavigationCell::IsPointInCellCollumn(const vector3& TestPoint) const{	vector2 TestPoint2D(TestPoint.x,TestPoint.z);	return (IsPointInCellCollumn(TestPoint2D));}inline const vector3& NavigationCell::Vertex(int Vert)const{	return(m_Vertex[Vert]);}inline const vector3& NavigationCell::CenterPoint()const{	return(m_CenterPoint);}inline NavigationCell* NavigationCell::Link(int Side)const{	return(m_Link[Side]);}inline float NavigationCell::ArrivalCost()const{	return(m_ArrivalCost);}inline float NavigationCell::Heuristic()const{	return(m_Heuristic);}inline float NavigationCell::PathfindingCost()const{	return(m_ArrivalCost + m_Heuristic);}inline int NavigationCell::ArrivalWall()const{	return(m_ArrivalWall);}inline const vector3 NavigationCell::WallMidpoint(int Side)const{	return(m_WallMidpoint[Side]);}//- End of NavigationCell ----------------------------------------------------------------//****************************************************************************************#endif  // end of file      ( NavigationCell.h )

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩欧美国产电影| 国产精品一区二区久激情瑜伽| 白白色亚洲国产精品| 国产精品久久久久7777按摩| av电影在线观看不卡| 成人免费在线播放视频| 91福利视频在线| 亚洲成人av电影在线| 欧美一级一区二区| 国内一区二区视频| 一区在线观看免费| 欧美亚洲日本一区| 另类小说视频一区二区| 欧美电影免费观看完整版| 国产一本一道久久香蕉| 中文字幕在线不卡国产视频| 欧美午夜免费电影| 久久se精品一区精品二区| 国产欧美在线观看一区| 色婷婷激情一区二区三区| 亚州成人在线电影| 久久久久久黄色| 一本大道久久a久久综合| 青椒成人免费视频| 国产三级欧美三级日产三级99 | 91丨porny丨户外露出| 国产激情视频一区二区三区欧美| 国产亚洲欧美激情| 欧美三级乱人伦电影| 国产专区欧美精品| 一区二区三区色| 精品国产制服丝袜高跟| 色婷婷久久综合| 国内精品国产成人| 亚洲电影中文字幕在线观看| 久久蜜桃av一区二区天堂 | 欧美三级日韩三级| 国产福利不卡视频| 日韩在线一区二区三区| 欧美国产日韩在线观看| 91精品国产欧美日韩| 成人国产精品免费| 久久综合综合久久综合| 亚洲美女屁股眼交3| 久久综合久久综合九色| 欧美中文一区二区三区| 成人一区二区三区在线观看| 丝袜美腿成人在线| 亚洲美女视频一区| 国产精品色婷婷| 精品国产一二三| 欧美私模裸体表演在线观看| 成人动漫av在线| 精品亚洲欧美一区| 亚洲chinese男男1069| 成人永久aaa| 精品制服美女久久| 日韩专区一卡二卡| 亚洲一区二区免费视频| 中文字幕一区三区| 2022国产精品视频| 欧美一区二区免费观在线| 欧美综合视频在线观看| 白白色 亚洲乱淫| 成人一级视频在线观看| 国产麻豆成人精品| 精品一区二区三区香蕉蜜桃| 日韩高清不卡一区二区三区| 亚洲综合丝袜美腿| 亚洲女人小视频在线观看| 欧美高清在线一区二区| 久久久九九九九| 久久精品人人做| 久久久久久久久99精品| 久久久久国产精品人| 久久天天做天天爱综合色| 欧美成人一区二区三区在线观看| 91精品国产aⅴ一区二区| 欧美一区二区视频在线观看2022| 欧美美女一区二区| 欧美日韩免费电影| 51精品视频一区二区三区| 欧美日韩国产片| 在线成人免费观看| 51精品久久久久久久蜜臀| 日韩亚洲欧美一区| 精品国产sm最大网站| 久久精品日产第一区二区三区高清版| 久久精品亚洲精品国产欧美 | 日韩一区二区三区精品视频| 欧美二区在线观看| 欧美电视剧在线看免费| 久久久亚洲国产美女国产盗摄| 久久精品欧美日韩精品| 最新国产成人在线观看| 亚洲乱码日产精品bd| 亚洲成av人片| 久久精品国产999大香线蕉| 国产一区二区三区在线观看免费视频| 国产成人超碰人人澡人人澡| 国产成人欧美日韩在线电影| 成人高清免费在线播放| 91亚洲精品久久久蜜桃| 欧美三级视频在线观看| 精品久久国产老人久久综合| 欧美激情一区二区三区蜜桃视频| 亚洲视频在线一区观看| 日一区二区三区| 国产精品亚洲一区二区三区在线| 99久久精品国产一区| 欧美午夜电影一区| 三级欧美韩日大片在线看| 精品无人码麻豆乱码1区2区 | 91美女片黄在线| 欧美一区2区视频在线观看| 欧美激情中文字幕一区二区| 一级日本不卡的影视| 美国毛片一区二区三区| 成人高清免费观看| 91精品国产综合久久久久久漫画 | 亚洲男人的天堂av| 青娱乐精品视频| 99久久国产综合精品麻豆| 91精品国产品国语在线不卡| 国产精品全国免费观看高清 | 欧美图区在线视频| 久久免费偷拍视频| 亚洲国产精品麻豆| 国产精品69久久久久水密桃| 欧美色精品天天在线观看视频| 久久亚洲影视婷婷| 亚洲国产精品久久人人爱| 大胆欧美人体老妇| 日韩一区二区免费在线观看| 亚洲欧美日韩人成在线播放| 国内精品免费在线观看| 欧美日韩亚州综合| 国产精品视频一二三区| 老司机精品视频一区二区三区| 91啪亚洲精品| 国产日韩欧美麻豆| 麻豆91在线播放免费| 欧美在线小视频| 国产精品国产自产拍高清av王其 | 久久精品综合网| 婷婷开心激情综合| 色婷婷av一区| 国产精品视频一区二区三区不卡| 美女高潮久久久| 777午夜精品视频在线播放| 亚洲特级片在线| 成人一区二区三区视频在线观看| 精品国产一区二区三区av性色| 视频一区在线播放| 欧美视频一区二区在线观看| 亚洲欧美影音先锋| 国产98色在线|日韩| www一区二区| 久久精品二区亚洲w码| 欧美精品v日韩精品v韩国精品v| 亚洲免费观看视频| 97精品超碰一区二区三区| 国产精品免费免费| 国产一区二区三区久久久| 精品久久久久久亚洲综合网 | 7777精品伊人久久久大香线蕉完整版| 一区二区三区成人| 91国偷自产一区二区三区观看| 亚洲天堂福利av| 91福利区一区二区三区| 一区二区三区四区视频精品免费 | 久久精品男人的天堂| 国产一区视频导航| 精品国产一区二区三区av性色| 蜜臀久久99精品久久久久久9 | 欧美日韩情趣电影| 亚洲国产精品自拍| 欧美另类变人与禽xxxxx| 午夜av一区二区| 91麻豆精品国产无毒不卡在线观看| 亚洲国产日韩综合久久精品| 欧美日韩国产综合久久| 日本aⅴ亚洲精品中文乱码| 欧美一区二区福利在线| 国产一区视频在线看| 欧美激情中文字幕一区二区| 91视频在线观看免费| 亚洲尤物视频在线| 日韩亚洲欧美一区二区三区| 国产一区二区成人久久免费影院 | 亚洲精品国产视频| 欧美视频一区二区在线观看| 天天综合天天综合色| 欧美精品一区二区久久婷婷| 国产一区二区三区免费看| 成人欧美一区二区三区白人 | 欧美日韩精品欧美日韩精品一 | 日韩国产欧美在线播放| 久久综合久久鬼色| 色偷偷一区二区三区|