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

📄 pointcloud.hpp

📁 机甲指挥官2源代码
💻 HPP
字号:
//==========================================================================//
// File:	 gosFX_PointCloud.hpp											//
// Contents: PointCloud Component											//
//---------------------------------------------------------------------------//
// Copyright (C) Microsoft Corporation. All rights reserved.                 //
//===========================================================================//
//
#pragma once

#include "gosFX.hpp"
#include "ParticleCloud.hpp"
#include <MLR\MLR.hpp>

namespace MidLevelRenderer {class MLRPointCloud;}

namespace gosFX
{
	//############################################################################
	//########################  PointCloud__Specification  #############################
	//############################################################################

	class PointCloud__Specification:
		public ParticleCloud__Specification
	{
	//----------------------------------------------------------------------
	// Constructors/Destructors
	//
	protected:
		PointCloud__Specification(
			Stuff::MemoryStream *stream,
			int gfx_version
		);

	public:
		PointCloud__Specification();

		static PointCloud__Specification*
			Make(
				Stuff::MemoryStream *stream,
				int gfx_version
			);
	};

	//############################################################################
	//########################  ParticleCloud__Particle  #############################
	//############################################################################

	class PointCloud__Particle:
		public ParticleCloud__Particle
	{
	public:
		Stuff::Point3D
			m_worldTranslation;
	};

//############################################################################
//#############################  PointCloud  #################################
//############################################################################

	class PointCloud : public ParticleCloud
	{
	//----------------------------------------------------------------------------
	// Class Registration Support
	//
	public:
		static void InitializeClass();
		static void	TerminateClass();

		static ClassData
			*DefaultData;

		typedef PointCloud__Specification Specification;
		typedef PointCloud__Particle Particle;

		enum {
			ParticleSize = sizeof(Particle) + sizeof(Stuff::Point3D) + sizeof(Stuff::RGBAColor)
		};

	protected:
		MidLevelRenderer::MLRPointCloud
			*m_cloudImplementation;
		Stuff::Point3D
			*m_P_localTranslation;
		Stuff::RGBAColor
			*m_P_color;

	//----------------------------------------------------------------------------
	// Constructor/Destructor
	//
	protected:
		PointCloud(
			Specification *spec,
			unsigned flags
		);

	public:
		~PointCloud();

		static PointCloud*
			Make(
				Specification *spec,
				unsigned flags
			);

		Specification*
			GetSpecification()
				{
					Check_Object(this);
					return
						Cast_Object(Specification*, m_specification);
				}
		Particle*
			GetParticle(unsigned index)
				{
					Check_Object(this); Check_Object(GetSpecification());
					return
						Cast_Pointer(
							Particle*,
							&m_data[index*GetSpecification()->m_particleClassSize]
						);
				}

	//----------------------------------------------------------------------------
	// Testing
	//
	public:
		void
			TestInstance() const;

	//----------------------------------------------------------------------------
	// API
	//
	protected:
		bool
			AnimateParticle(
				unsigned index,
				const Stuff::LinearMatrix4D *world_to_new_local,
				Stuff::Time till
			);
		void
			CreateNewParticle(
				unsigned index,
				Stuff::Point3D *translation
			);
		void
			DestroyParticle(unsigned index);

	public:
		bool
			Execute(ExecuteInfo *info);
		void
			Draw(DrawInfo *info);
	};
}

⌨️ 快捷键说明

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