⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mlrlookuplight.hpp

📁 机甲指挥官2源代码
💻 HPP
字号:
//===========================================================================//
// Copyright (C) Microsoft Corporation. All rights reserved.                 //
//===========================================================================//

#pragma once
#define MLR_MLRLOOKUPLIGHT_HPP

#include "MLR.hpp"
#include "MLRInfiniteLight.hpp"

namespace MidLevelRenderer {

	//##########################################################################
	//########################    MLRLookUpLight    ############################
	//##########################################################################

	class MLRLookUpLight:
		public MLRInfiniteLight
	{
	public:
		static void
			InitializeClass();
		static void
			TerminateClass();

		MLRLookUpLight();
		MLRLookUpLight(
			Stuff::MemoryStream *stream,
			int version
		);
		MLRLookUpLight(Stuff::Page *page);
		~MLRLookUpLight();

		void
			Save(Stuff::MemoryStream *stream);
		void
			Write(Stuff::Page *page);

		virtual LightType
			GetLightType() 
				{ Check_Object(this); return LookUpLight; }


		virtual void
			LightVertex(const MLRVertexData&);

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// LookUp Light Specific
	//
	void
		SetMapOrigin(Scalar x, Scalar y, Scalar z)
			{ Check_Object(this); mapOrigin.x = x; mapOrigin.y = y; mapOrigin.z = z; }

	Point3D
		GetMapOrigin()
			{ Check_Object(this); return mapOrigin; }

	void
		SetMapSizeAndName(int x, int z, const char *name);

	int
		GetMapZoneCountX()
			{ Check_Object(this); return mapZoneCountX; }
	int
		GetMapZoneCountZ()
			{ Check_Object(this); return mapZoneCountZ; }

	const char*
		GetMapName()
			{ Check_Object(this); return mapName; }

	void
		SetMapZoneSizeX(Scalar x)
			{ Check_Object(this); zoneSizeX = x; Verify(x>SMALL); one_Over_zoneSizeX = 1.0f/x; }
	void
		SetMapZoneSizeZ(Scalar z)
			{ Check_Object(this); zoneSizeZ = z; Verify(z>SMALL); one_Over_zoneSizeZ = 1.0f/z;  }

	Scalar
		GetMapZoneSizeX()
			{ Check_Object(this); return zoneSizeX; }
	Scalar
		GetMapZoneSizeZ()
			{ Check_Object(this); return zoneSizeZ; }

	void SetLightToShapeMatrix(const Stuff::LinearMatrix4D&);

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Class Data Support
	//
	public:
		static ClassData
			*DefaultData;

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Testing
	//
	public:
		void
			TestInstance();

	protected:
		bool
			LoadMap();

		Point3D mapOrigin;
		Scalar zoneSizeX, zoneSizeZ;
		Scalar one_Over_zoneSizeX, one_Over_zoneSizeZ;

		int mapZoneCountX, mapZoneCountZ;
		MString mapName;

		unsigned char **maps;

		Stuff::LinearMatrix4D
			shapeToWorld;
	};

}

⌨️ 快捷键说明

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