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

📄 bp_proxy.h

📁 opcode是功能强大
💻 H
字号:
/*
* SOLID - Software Library for Interference Detection
* Copyright (c) 2001 Dtecta <gino@dtecta.com>
*
* All rights reserved.
*/

#ifndef BP_PROXY_H
#define BP_PROXY_H

#include "BP_Endpoint.h"
namespace OgreOpcode
{
	namespace Details
	{

		class BP_Scene;

		class BP_Proxy {
		public:
			BP_Proxy(void *object, 
				BP_Scene& scene, 
				const Ogre::Vector3& min,
				const Ogre::Vector3& max);

			void setBBox(const Ogre::Vector3& min, const Ogre::Vector3& max);

			void *getObject() { return m_object; }

			Ogre::Real getMin(int i) const { return m_min[i].getPos(); }
			Ogre::Real getMax(int i) const { return m_max[i].getPos(); }

		private:
			void        *m_object;
			BP_Scene&    m_scene;
			BP_Endpoint  m_min[3];
			BP_Endpoint  m_max[3];
		};

		inline bool BP_overlap(const BP_Proxy& a, const BP_Proxy& b)
		{
			return a.getMin(0) <= b.getMax(0) && b.getMin(0) <= a.getMax(0) && 
				a.getMin(1) <= b.getMax(1) && b.getMin(1) <= a.getMax(1) &&
				a.getMin(2) <= b.getMax(2) && b.getMin(2) <= a.getMax(2);
		}

	}
}

#endif

⌨️ 快捷键说明

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