ogrepaginglandscapepagedata2d_spline.h

来自「赫赫大名的 OGRE 游戏引擎」· C头文件 代码 · 共 77 行

H
77
字号
/***************************************************************************
	OgrePagingLandScapePageData2D_Spline.h
	Header for a NURBS-based heightfield generator
	-------------------
	begin                : Sat Nov 9 2003
	copyright            : (C) 2003 Chris "Antiarc" Heald
	email                : antiarc@captionthis.com
***************************************************************************/

/***************************************************************************
*                                                                         *
*   This program is free software; you can redistribute it and/or modify  *
*   it under the terms of the GNU Lesser General Public License as        *
*   published by the Free Software Foundation; either version 2 of the    *
*   License, or (at your option) any later version.                       *
*                                                                         *
***************************************************************************/

#ifndef PAGINGLANDSCAPEPAGEDATA2D_SPLINE_H
#define PAGINGLANDSCAPEPAGEDATA2D_SPLINE_H

#include <OgrePrerequisites.h>
#include "OgrePagingLandScapePageData2D.h"
#include "DRGNURBSSurface.h"

namespace Ogre
{

/**
  * A specialized class for loading 2D Data from a Spline file.
  */

class PagingLandScapePageData2D_Spline: public PagingLandScapePageData2D
{
public:
	PagingLandScapePageData2D_Spline();
	~PagingLandScapePageData2D_Spline();
	void load( float mX, float mZ);
	void unload();
	float getHeight( float x, float z );
	float getError( float iniX, float iniZ, float endX, float endZ );

protected:

	bool _checkSize( int s )
	{
		for ( int i = 0; i < 16; i++ )
		{
			printf( "Checking...%d\n", ( 1 << i ) + 1 );
			if ( s == ( 1 << i ) + 1 )
			{
				return true;
			}
		}
		return false;
	}

	int mSize;
	int mMax;
	int degree;
	int mResolution;
	bool mLoaded;

	Point4D *mPoints;
	CDRGNURBSSurface *mSurface;

	inline float _Max( float a, float b )
	{
		return ( ( a > b ) ? a : b );
	};

};

}

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?